How long do i have

If I'm ovulating do I have to have sex right on that day or can it be the day after ? Will I miss my window or is there still a possibility I can get prego? How long does egg wait for sperm is my question ?