There comes a time in every players game when he/she thinks, "it's time I folded the tent". When this point is reached, is it when your Loss Limit is reached, or some mathematical method based on the number of Buy Ins or BBs, or even a gut feeling that you are getting nowhere, or something else?
Your question is a bit ambiguous - some people answer when they (would) quit poker in general, some when they quit a game or a session ...
I think that quitting is, in general, the biggest challenge and the point where you can see whether you have a healthy approach or not - if you want to see it.
A friend of mine told me about the post of a professional poker player (I haven't looked it up, maybe it was even here?) just a couple of weeks ago who had an incredible run at en event (not in the tournament, but playing cash as I understood it) and came as far as having a plus of $900.000. Yet, he absolutely wanted the million and ended up being in red numbers of over -$200.000.
Quitting after winning might be the hardest thing. Afterwards you know what your highest win was and that you should have stopped there, but while your playing, your winning and losing all the time and you just don't know when the final decline starts.
So in this case I think that you have to countertrick your mind that keeps telling you you should win back what you just lost, and draw a red line - if this poker player had drawn it at $500.000 it would have felt like losing $400.000
in the situation but afterwards he would have realised that he won an incredible half million dollars!