Let’s all go back to Guidance class (or Sex Ed, whatever they called it in your school) and review a woman’s cycle:
On Day 1 of a woman’s cycle, her period begins. This consists of the lining of the uterus, which has been building up over the previous three weeks, falling out (kind of like skin peeling after a sunburn). Periods can last anywhere from two to ten days.
At around Day 14 of the woman’s cycle (that is, two weeks after her period begins) the woman ovulates. This consists of her ovaries (or more accurately, one ovary) releasing a mature egg, which is ready to be fertilized by a man’s sperm. Ovulation can occur as early as Day 7 and as late as Day 21. Ovulation is typically, but not always, accompanied by more gelatinous vaginal discharge and horny feelings.
Around Day 28 the woman’s period starts again, provided that the egg was NOT fertilized, and the counter is reset to Day 1.
A mature egg, once released from the ovary, has a viable lifespan of only about 12 hours. This is why women who are trying to get pregnant use “ovulation indicators” that inform them of when they are ovulating. I’m not entirely sure on this one, having never used them, but I believe they measure the amount of a certain hormone in the woman’s urine.
No problem, you say, avoiding pregnancy should be easy - just stay away from ovulating women. Unfortunately, the male sperm is a hardier creature than the female egg, and its viable lifespan, once inside a female, is around 5 days.
Given that it’s pretty hard, really, to predict EXACTLY when a woman will ovulate, and the fact that under some circumstances, if a woman has sex during her period and then ovulates early, some sperm will stick around long enough to fertilize the egg, it is NOT a good idea to assume that if a woman has her period, she isn’t going to get pregnant. In fact, to be absolutely safe, it’s a good idea to avoid unprotected sex completely until Day 21. The safest time for unprotected sex, pregnancy-wise, is in the week just prior to the woman’s period. If she’s checking for ovulation, though, then two days after ovulation should be safe.
As far as STDs go - only abstinence or total monogamy is entirely safe. Handy is correct in that levels of HIV sufficient to detect to not appear in the body for some time after infection (although I heard it as 6 months, not 3). Condoms and spermicide can provide a certain amount of protection, but they are not foolproof.
Hope this helps. As someone (albeit mildly) allergic to latex, I’ve had to be EXTREMELY careful on this whole issue.