Compute the average payoff. If it's positive, it's investing. If it's negative, it's gambling.
Gambling has a negative, random payoff.
Investing to me is more about mindset and the manner in which you deploy capital for a return, and how much you are relying upon luck, guesswork, and chance.
In general, over the long term, investing makes money.
In general, over the long term, gambling loses money.