Do you have to have sex on the day you ovulate in order to get pregnant or can it b a day after ovulation and on a fertile day?

Around the day. It can happen around the day you ovulate. Sperm can survive for a day or so in the vagina, so a day or so before you ovulate, or a day or so after etc. Is still a viable time for you to get pregnant.
Back to School. Health class 101. Sperm live up to five days post ejaculation inside a female. Sperm deposited in the vagina during the five days prior to ovulation are the sperm most likely to cause pregnancy. Ovulation is both a description of those five days and also the event of the readied egg being released to meet the sperm by the ovary. Sperm deposited after ovulation are less likely to cause pregnancy.