Yes, these plans are called Return of Premium life insurance policies, and they are term (temporary) life insurance plans.
With term insurance, you select a term (duration) for your life insurance policy to last.
If you pass away during the policy term, your beneficiary receives the death benefits. If you outlive the duration of your term policy, there is no payout of benefits.
Regular term life plans do not return premiums; however, return of premium term life plans do return your premiums if you are alive when your life insurance coverage expires.
Here's how to learn more about term life insurance with payback of premiums.