Morning after pill

Had unprotected sex yesterday(Sunday) when's the latest I can take the morning after pill and will it work?