One question that is obvious is, “If the job is long term and stable, why would I need to know when to go?” Are you planning to work until you die? Not likely. So again, know when to go.
I recently left a job that I had been at for a little over a year. It was a paycheck, and I did enjoy some of the people I worked with, but it was time for me to move on. How did I know? When all of the little things that were okay, or quirky, or sometimes cute, were no longer any of those things, it was time to go. All of the previously endearing things turned annoying, so I had to get out. I could have stayed. I could have stuck it out. But if I had done that, I would be bitter and probably not care for any of the people that I worked with anymore. That is not a great situation for anyone, so I left.
One key part of knowing when to go is being able to go when you need to. We liked the extra income in our house, but we had a plan, and we had money in the bank, so I was able to move on to the next adventure. If you are in a position where you are stuck because of not having a plan or having money in bank, then change things. If it is time for you to go, then you need to hustle enough to make it happen. There is no winner in you staying in a place where you are not happy and don't want to be.