While every company is different, you’ll likely need to call your lender to take gap insurance off your loan. It’s unlikely that there would be a set expiration date apart from the payoff date of your loan.
If you purchased gap insurance through your car insurance company, you probably pay monthly for coverage. In this case, you can cancel it at any time by calling your provider.
Most lenders allow you to cancel gap insurance if you no longer want it. Depending on the carrier and how you pay for your gap insurance, you may also get a prorated refund. If you cancel before the end of your loan term, you’d receive any unused premium back.