Thanks for the query.
There are a variety of Contraceptive Pills that are available in the market.
There is a Contraceptive Pill, an Emergency contraceptive pill
that needs to be taken within 72 hours after an unprotected Sexual intercourse to prevent pregnancy
However it is advisable to take the drug with a doctor's prescription.
All other contraceptive pills need to be taken every day for 21 days in a month continuously at bed time, even though the intercourse may not happen frequently.
There are many commercially available contraceptive pills that are all "Over the Counter drugs" , You do not need any prescription for them. You can directly buy them from your local chemist.