The timing of when people have sex, doesn’t affect how well the pill works. The pill works to prevent pregnancy by changing the hormone levels in the body over a whole month. It is taken every day, ideally at the same time each day to prevent pregnancy.
The pill is 91% effective with typical use (not following the exact directions). Most pregnancies happen because people forget to take their pill.