There’s no simple rule for knowing when it’s time to leave a job/project/gig (or any other endeavor, for that matter). But if you are working a job or pursuing a project mainly in order to learn, the decision can become a little bit clearer.
There are learning curves with every job. For some highly-demanding jobs, the learning curve can be months. For highly-technical jobs, the learning curve can be years. For simple manual labor jobs, the learning curve may only take weeks.
You’ll know you’re ascending the learning curve if you find yourself full of self-doubt, stress, or the pleasure of continual mastery (sometimes all at the same time). You will learn something new every day, or every other day. You will wonder if you are doing things right. You will make mistakes.
You know you are at the top of the learning curve when you stop feeling stressed about not knowing what you are doing. If you can go into work and have an “easy” day, you have probably passed the peak of your learning curve.
You leave when you have passed the top of the learning curve (all other considerations aside).
When you pass the top of the learning curve, you have probably learned most of the core skills or insights that the project/job/gig will give you. Continual daily repetition of those routines has benefits (and is certainly important for achieving a mission), but it’s not going to teach you all that much more.