Essentially - the plot line has to come to conclusion/resolution. The technical ending may differ - a happy end, a cliff-hanger, afterword, whatever...
I just finished a story, it's in the final look-see, that started at the end of the story. When I came to the last chapter, there was no need to end it.
I usually start with the end-scene in mind (together with some earlier ones) so the book ends when I finish writing that scene. There is sometimes a little "washup" chapter. That main scene usually concludes the point I was trying to make in that book. As with any "rules" there ear expceptions. The ending in Athene's Prophecy is more to show the random nature of the imperium of Caligulae, so if you didn't pick that as the main theme, and arguably others are more important, the ending does not follow from what came before directly, but rather from the clues in the asides.
A statement attributed to Frank Herbert. How do you know when to end or stop the story? Thoughts!