Well in gambling I set a limit like I will bet 10$ and I will stop once I get 20$ from it and If I lose I will never deposit again 10$ to win that lost amount of money back. You should know that gambling doesn't give you anything instead of loss.
But they eventually stop when they become bankrupt and so it isn't that they don't know when to stop but they just can't stop because they are motivated by flimsy excuses that they are going to turn in profit somehow and this deception gets them into a worse state..
Because there are some people that uses gambling to earn a living without even notice that they actually losing it. They treat this a job more than for fun that's why they're always eager to win and sometimes even they knew they losing they still roll the dice and in the end instead of having some money and call it a day they still go for it until their pocket is empty.
Well, I have heard of some people who have always had some luck one way or the other, but it seems to me as a rare thing that not everyone gets that chance. However, it is all just about self control and having a decision that no matter what, I just have to stop after I either hit this or lose this.
I think such sort of people must not quit in any sense and keep on saving bucks for future use or business purposes. The best answer to this question that when to stop is that you must stop when you are at risk.