Emergency contraception (often called the morning after pill) does NOT work like a regular birth control pill. While the latter is taken daily and contains far fewer hormones, the emergency pill is made for...that’s right: EMERGENCIES!
It works mainly by stopping or delaying the ovaries from releasing an egg. It may also work by changing the lining of the womb that may prevent implantation of a fertilized egg.
Emergency contraceptives are most effective when taken within 12-24 hours after unprotected sex.
Depending on the type of emergency pill, it can be taken within up to 3 or 5 days after having unprotected sex and prevents pregnancy by releasing a (high) dose of hormones. For the best chance for it to work, you should take it as soon as possible.