PG has an answer.
You should change your idea when you (a) have new one you’re convinced is better, and (b) it won’t cost too much to switch to it (e.g. because it overlaps a lot with your current idea).
Harder to say when to quit. I suppose you quit when you can’t take it anymore. Which means deciding that depends less on the product than on you.
Another thing to note is “are you able to let it go” For all the effort that you have put in? The sunk cost effect.