It sounds like a silly question, but there are a lot of people, writers who feel their work is the be-all and end-all and doesn’t need any more editing. Here’s a blog post I’ve done that might change your mind.
So when do you quit editing? When you submit your final copy for publication, of course. After the editor/publisher has taken a look at it and after you think you’ve got all the bugs out, naturally. Even then, there have been times when the final copy has what you feel is a glaring error in it.