This is a common question that many of us have and the answer is somewhat elusive because each of us has our own particular goals for our work. To make it even more complicated an artist may have different purposes for different works so the answer can change depending on the immediate goal. Ultimately, the painting is done whenever it has expressed the message in the way the artist intended it to be understood. It may even mean that a piece will need to be done more than once before you get it right.
Ilya Repin is a shining example of someone who had the diligence to see his vision to it's conclusion. Here are a couple of images of the same theme.
It's interesting to see that even though the first is masterfully done he decided to take up a new canvas and try it again. All the additions and alterations really ad up to something much more amazing that is filled with psychological tension.
Seeing things like this are a reminder to not give up on an idea the first time around. If you really believe in it you should keep going until you've found the solution you are truly looking for.