As long as you know when to call it a stop. Most important you know what you are doing. But most of the time it's not the case as emotions tend to take over and that is where you go deeper and deeper. So it is wrong? I don't think so because you are the one to make the call.
There are two types of gambling one is playing casino or similar site to put money to become fast rich is absolutely wrong because your will never ever satisfied with your winnings. After you win some then you will try for some and finally you will loose every thing.
The other kind of gambling is investing in stock market for long term should be a better option if you want to grow your money for long term. You should choose a good company stocks for long term gains but if you start trading then it will be purely gambling and you will loose your money soon or later.