If you can obtain an edge through a skill component (card counting in blackjack), some people wouldn't call this gambling anymore, but I would still call it gambling myself. Someone doing this for a living is a professional gambler.
What for me would be a sensible definition is that a bet/gamble has no other goals. Putting money in the bank/investing in a stock reallocates capital, which can be invested by someone. The fact that it is a risk-taking endeavor is merely a side effect. I would say the same goes for selling/buying insurance for your car.
So for me, the difference between betting and putting money in the bank/investing is that the primary goal is something different than the risk-taking activity.