In most cases the contraceptive lasts only as long as you are using them. If you stop a contraceptive then your ability to have a baby returns immediately. The exceptions to this are the permanent methods, such as a vasectomy or tubal ligation, or the injection, after which your fertility can take a few months to return.
If you’ve recently had a baby or just had an abortion and want contraception then don’t delay. You are at risk of another pregnancy very soon after these events if you have unprotected sex. Speak to your doctor, nurse or pharmacist about your contraceptive choices.