First - this is a completely reasonable question - don't feel bad asking!
You more than likely have something called vestibulitis. It's just a skin condition that affects the "vestibule" or outer area of your vagina and it can be extremely painful to have intercourse while it's flaring up. Having your period, being in chlorine, using certain detergents or body washes, certain brands of tampons/pads, most lubricants, etc. can cause a skin reaction. If you've stayed away from those things, you might think sex is just fine. If, however, you've done/used some combination of them, you've probably had a reaction and didn't realize it.
Please just go to your gynecologist and explain that you're having pain with intercourse on occasion. The doctor will ask if you're currently having pain and do a brief visual exam to see if your vestibule skin is red. If it is, problem solved. If not, he/she may diagnose you based on symptoms described. The "treatment" is to put a steroid cream on once a day for a week or two to strengthen that skin, and then to always use some sort of barrier (such as zinc oxide) on your skin during intercourse. If it flares up easily, you may also want to avoid colored/scented body washes and lotions (at least for awhile), switch to pads instead of tampons for a couple of cycles, and wear white cotton underwear during your period especially so you're getting better airflow down there and not putting dyes right next to already sensitive skin.
Hope this helps and that you get the treatment you need before it gets worse for you!