The answer is both Yes and No for this question. But the answers are applicable to different people.
First and foremost, Gambling is the wagering of money or something of value on an event with an uncertain outcome, with the primary intent of winning money or material goods. In this definition, the uncertainty of the outcome is the key to define anything as gambling.
Stock markets, on the other hand, are not so uncertain. People have made a fortune by investing in stock markets. Warren Buffets, known as the Wizard of stock markets became the 2nd richest man in the world by wisely trading in stocks.
Watch the video to hear it from investment guru Murali Kabirdass.