Term life insurance provides a set death benefit amount, for a set cost, and for a set period of time. Its main purpose is to pay out a sum of money to provide financial assistance to those who are in some way or another financially dependent on someone else. While this is (or should be) the main purpose of any life insurance policy, among all the different types of life insurance, term life insurance is almost always (and by far) the lowest-cost option to accomplish this purpose. Term life insurance will likely also be the best option if the financial need is for a limited time, such as until children are financially independent, the mortgage is paid-off, and/or retirement savings are in place.
Once the predetermined term length of a term life insurance policy has expired, the policy owner can still choose to keep the policy but the cost of the policy will increase significantly (based on the policy owner being older) and continue to do so on an annual basis. Nevertheless, the policy owner can choose to cancel the policy at any time during the life of the policy, and there are no charges or fees for doing so (but there will also be no benefit paid out upon cancellation). They can either complete some paperwork to submit to the company notifying them that they no longer wish to keep their policy; or, even easier, they can simply stop paying their premium and the policy will automatically cancel on its own.
If you are wanting a life insurance policy solely for the benefit it will pay out in the event of your untimely death, and only need it for a specific amount of time, the best and lowest-cost type of life insurance policy for you will likely be a term life insurance policy.