Thank you for this. I'm new to SWE. How to know when it is time to leave an organization versus sticking it out?
So many factors are envolved in this that it is hard to begin the answer. I would spend some time discovering the main points and answer them.
One that is very important: Do you have another opportunity to accept? There is nothing better to get a job than being employed.
If you do have a offer, consider if you take; but if you don't, try to get one while you are employed and jump ship when it's a better one; repeat.
If you're still learning or giving opportunities to learn new things, stick it out. If you're stagnating and not allowed to learn new things, it's time to leave.
For the first 10 years or so, this is relevant. After that you can figure out what you really want to do.