In my opinion, the right time to stop depends on each gambler. For example, if they're addicted, they'll likely stop when they're all gone. If they win, they'll usually continue until they're satisfied and then lose again. So, in my opinion, the skill of stopping at the right time is likely only achieved by responsible gamblers who aren't overly obsessed with winning.
The right time to stop depends on the limits of the gambler, and it is the reason why the people that know how gambling works don’t fall for tricks and the people that believe that their luck works for them end up losing their money because most of the time when they are winning, they continue playing until they start losing again. Being responsible while gambling helps a gambler a lot because it helps him implement his limit when the need arises, and it also saves him from losing because he knows when to stop the game.
But for the irresponsible gamblers, they think their luck works for them, and so they continue playing until they lose all their money, and when they are winning, they eventually start losing again; only the lucky ones stop when they lose after winning their bet.