You are at your most fertile the day before and the day of ovulation. Since sperm can live up to 5 days after sex, if you have sex within this window before you ovulate, you can get pregnant.