I think its better if we are already on profit then we should withdraw our profit and our capital to avoid losing everything. I've seen this happen to a lot of gamblers who keep on betting because they want more profit and they end up losing all the money.
If you gamble without any target set then mostly you will stop only after losing all your bankroll. That's why many people suggest having some target in gambling to avoid huge losses. We all know that in gambling most likely we lose money in the long run so better don't use bigger bankroll instead use a small amount to enjoy your favourite games.
I believe that we should control our self while gambling because it is easy to loss money but tough to recover money. I totally agree with you that if we can target set then we can easily avoid bigger losses in the long term. Obviously, if we can enjoy with small amount for fun and if, it favors for us then you could be lucky too. Thus, it is better to play with money that we can afford to loss.