Trading is trading. Gambling is gambling. So that is the different. But some people will say that trading can become gambling so that is right. Trading become gambling when you buy a coin without analyzing and choose randomly and predict if that coin can increase soon.
Cash out in gambling will prevent you from the lose. That will similar with stop loss in trading. If you can use both in trading and gambling, you will prevent the loss. But badly, most people are tempting to become greedy in gambling and trading so they are not use that feature because they expecting a big profit.