That depends on the type of life insurance policy you get.
Whole life insurance will last until you die, as long as you continue paying your premiums on time.
Whereas, term life insurance is temporary, providing protection for a specific period of time.
The "term" is the duration of your life insurance coverage.
However, you may be able to renew your coverage for an additional period of time when your original policy term expires, but you will pay a higher premium at renewal.
Also, your life insurance ends after you stop paying your premiums and the insurer cancels your policy, or if the insurer cancels your coverage at your request.
In addition, an "In Force" life insurance policy ends coverage at the time of the insured person's death.