There are many different types of life insurance policies. Some include a "cash value" feature where part of your premium pays for the death benefit and part is invested by the life insurance company and builds cash value over time. "Cash value" policies are also sometimes called "whole life" policies. These policies can be canceled by the policyholder at any time and you will then get back the cash value of the policy. They can't be canceled by the insurance company except for non-payment of the premium. But if you have a cash value policy, how the money is invested, how the cash value is calculated, and how the refund is generated would have been discussed with you in great detail before you bought the policy, and will be prominently shown in the policy documents. Of course, this type of policy has a larger premium than a non-cash value policy (assuming the death benefit is the same.)
A non-cash value policy is usually called a "term life" policy. This policy provides a death benefit only, and has no cash value. Most term life policies cover you only for a certain period of time then they automatically expire -- typically 10 years, though there are lots of options (Currently, I have a 30-year term life policy.)
You said "is all the money you invested gone." The word "invested" would only apply if you bought a cash value policy. A term life policy is not an investment--you pay for a month of protection, you get a month of protection; you pay for a year of protection, you get a year of protection. If you don't die, it doesn't mean you got burned--you still had the protection you paid for even though you didn't die. You're a winner not a loser! But it's not an investment.
Now, let's go one step farther. Let's say you have a term life insurance policy, you're over 60 years old, and you can't afford the premium anymore. It might be possible to "sell" the policy to an investor who would be willing to pay the premiums provided you name them the owner and beneficiary of the policy. In other words, they are betting you'll die and they'll collect. There are businesses out there that this is all they do. There are lots of them--some are honest and trustworthy, others are really really sketchy. If you want to research this some more, you want to google for "life insurance secondary market." The other term you might search for is "viatical settlements". If you decide to go this route, make sure you get a really good adviser to help you because it's easy to get screwed if you don't know what you're doing.
I'm a retired insurance agent.