What is meant by “Cash it in” in Joe Biden's phrase, “I began to understand how despair led people to just cash it in.”?

Solution 1:

Cash it in means give up on or surrender. So you can cash in an insurance policy or investment by surrendering it and getting back any value. It's also from the cashing in of chips at a casino when you stop gambling and take any remaining money

Solution 2:

mgb has explained the origin of the expression. A little more context would be useful in this case, but Biden may hve meant this as a euphemism for the ultimate giving-up, that of suicide.