Life insurance is intended to cover death as a result of natural causes or accidents, not intentional acts, such as suicide.
However, since life insurance is a state regulated industry, the states make the laws regarding the issuance of life insurance and the rules that apply to life insurance policies.
In most states there is a two year exclusion period for suicide, but one year in some states like Colorado.
This means, the suicide exclusion applies to your life insurance coverage. So, if you live in a state with a 2 year requirement, then a death occurring within the first two years of the time you bought the policy will not be paid out if death occurs as a result of suicide.
But, if the insured person commits suicide after owning the life insurance policy for more than 2 years, then the death benefit will be paid out to the beneficiary of the life insurance.
In addition, the Social Security Administration may pay some death benefits to the spouse and/or children a deceased person who dies as a result of suicide.
Here is an article that provides more information and resources related to Life Insurance and Suicide.