One should stop gambling when they are not getting the excitement even while gambling, they just feel nothing after the session, but it is hard to be the case because people will feel excited when they are winning some real money. So this is about time management and spend some time when you are bored then you will feel the thrill and move on to your sucking real life, never use gambling as an escape mechanism from your financial burden, which will cause you even more financial trouble.
The moment you gamble to fix financial problems or chase losses, you're setting yourself up for disaster, so treating it purely as entertainment is important.
For me personally I have a simple rule whenever I sit down for a casino session, I crack open my first beer when I start and by the time I finish my 6th beer, the session is over no exceptions. Win or lose, that’s the end of the night.
The moment you start treating it as a way to chase money, you've already lost. If you treat it as fun and a relaxed evening with a few drinks, then whatever you win or lose at the end doesn't feel like a big deal either way.