The morning after pill is most effective if taken up to 72 hours after unprotected sex. However, it can still be taken up to 120 hours (five days) after sex, although its effectiveness will decrease. So, the timing of when you take the morning after pill is crucial.
But, keep in mind that the morning after pill is not a replacement for regular contraception. It is only meant to be used in emergencies if other methods of contraception fail. It also does not protect against sexually transmitted infections.
If you forget to take your regular contraception or experience a condom malfunction, it's essential to consider taking the morning after pill as soon as possible. The sooner you take it, the more effective it will be. The 72-hour window is your best chance to prevent an unplanned pregnancy.