There's a lot of advice on how to get your butt in front of the computer/typewriter/blank page, but not a lot on how to know when to stop and what to do when you d stop.
Like most, I struggle with motivation and find it far easier to find distractions than reasons for sitting and working. However, I think I may be somewhat rare in that if I don't write I feel like hell. I feel the same way if I don't run or get some activity outside that stresses and strains my body. The muscles (writing muscles and body muscles) need to be worked in order for me to feel physically, mentally and emotionally healthy. I get edgy and nervous when I don't write for too long or exercise.
Like exercise, you have to know when to stop writing. Hemingway was right in that a writer needs to stop before he or she has finished a thought or a scene. You need to write for a determined period of time or word count, but it's also important to leave a little off the page and not finish or complete a section, chapter or story. I'll stop at such a point and write a note to myself below where I left off so I know what I was thinking when I come back.
Doing this keeps the subconscious mind engaged and active through the remainder of the day and night. I find that as I fall asleep answers to writing problems and new ideas come to mind and I either jot them down on paper or send myself an email as a reminder.
When I return to it the next day, my mind is ready to launch back into the writing because I've looked forward to finishing the idea or scene or situation I was working through the day before. I also have the note to myself and my new ideas on a piece of paper or in my email and I can get to work.
This also helps with the motivation dilemma. If you are excited about an idea or the way something is going, then you will be more apt to return to it the next day or two.
There's also the question of how much is enough. That's up to you. Some people set a word count of 2,000 words or 500 words, whatever works for them. I read an interview of Mary Karr and she said she basically worked out Lit in her mind and sat down and wrote for hours and hours without breaks. For me, six hours of intense writing is about as much as I can handle. I try to get up as early as I can and write for as long as I can and use the afternoon for interviews and other tasks that help me prepare for writing, but don't demand intense focus.