No, not the book, though that's another topic. This isn't about how to wrap the book into a tight little bow...or leave just the right amount of foreshadowing to the next.
This is about when to stop writing. I was asked this recently. How do you know when to give up...when to quit? This was my answer.
Years later, he saw the master again and asked what in his performance had convinced him that he'd never make a good musician. The master told him that he routinely said that to every student who approached him. If the student put down his instrument, if was never meant to be. He didn't have the drive to sweat and bleed to make his dream happen. If the student told him he was an old hack...or even respectfully disagreed, he knew that student had a CHANCE of making it, because the dream was too much to be crushed, even by his condemnation. It all depended on the determination of the individual and the willingness to sweat and bleed to learn and practice and hone the art.
So, the short answer...if this can be considered short... As long as you have the drive to write... As long as the muse hounds you, day and night... As long as you know you will do this for the love of it, no matter what hack tells you you're doomed or how many rejections you amass, you continue to write. Why? Because someone who lives and breathes the written word doesn't give up, no matter what someone says.