When should you quit writing?
It depends on why you write. If you write for the money, you should quit after 10 or 15 years without getting published. If you write because you like it, you won't even consider the question.
Me, I enjoy writing. I also enjoy playing my guitar. Although I may never become a professional writer (and I certainly won't become a professional guitarist), I enjoy creating stories and other worlds.
Quitting is not an option for the person who loves what they do.