You need to know yourself, both mind and body. If you're in a good game and playing well, why would you leave? You're just leaving money at the table. Equally, if you know that after 2 or 3 hours your mind begins to wander and you start making mistakes, you have to be disciplined enough to get up and walk away. Try setting an alarm in a different room so that you actually have to walk away from your computer for a few moments.