Best time to quit
The best time to quit is before you start. The worst time to quit is after you have put in all the effort with no reward. The worst reason to continue going is because you have put in all the effort.
Starting is done best when you keep this in mind: There are specific outcomes that you value, you know that it will be hard, and you know what success looks like.
If you cannot start that way, freely quit. Find and do the things you can start and finish.