I think the ideal time to stop a cash game session is when simply, you are done playing. That may seem to oversimplify if, but the reality is, there are going to be all kinds of situations you may be in when you decide you should stop playing. Maybe you aren't playing well and even though you're down, you should stop and try again in a future session. Maybe you aren't playing well, but happen to have gotten lucky. Maybe you're tired. Maybe you don't have much time left anyway. And the list goes on. But in the type of situation you mentioned, if the good feeling of being ahead (and your bankroll being better at that moment) is enough of a reason to stop and walk away happy, then go ahead and stop. There's nothing wrong with stopping if your happy, and content. If you are playing well, and have plenty of time to keep playing, then strongly consider continuing to play. You just need to be able to make yourself at least somewhat comfortable with the fact that, if you continue to play, you may lose all that you're ahead and maybe worse, but that's okay because that's poker sometimes, but you are playing well right now, so it's better to keep at it.