Before researching this topic I thought the answer to the difference between investing and gambling would be clear-cut. Instead I discovered it really comes down to what you choose to invest in.
It is a fact that the stock market has grown at approximately 10.5% per year since 1926, including all the market crashes since then, which appear as little blips on a steep incline in the whole scheme of things.
So to effectively take out the risk (gamble) of investing it would be wise to invest in household names for the long term. If you were around in 1919 and were luckily enough to invest $4,000 in Coca Cola, you would have got yourself a $600,000,000 return by now! Or if you had purchased just ONE share, you would by now you would, through dividend reinvestment and stock splits, be a millionaire.
A more recent example would be Microsoft. If you invested $10,000 in 1986, you would have had a $6,000,000 return by 2000.
To find companies like these to invest in you would look for index funds that perform well or mimic the Wilshire 5000, S&P 500 or Russell 2000.
If you buy into stocks on a whim, do no research or act on a tip from someone who doesn’t know his bears from his bulls then this behavior could be construed as gambling rather than investing.
The boundaries between gambling and investing start to merge more when you employ strategies like day trading and swing trading, or when you invest in biotech companies that have drugs that are currently being researched in clinical trials, etc. The emotions and rush of adrenalin must be similar as you weigh up the wins and losses each day.
Really the difference boils down to the fact the longer you stay in the game with investing, the more likely you are to succeed and be the winner but the longer you stay at the casino table the more likely you are to lose everything.