I say "mostly" because less than a year, without good explanation, can be a detrimental factor on your CV. Two years is probably good. But ... rules are made to be broken: don't stay if it's really bad, or something really good comes up.
Other than that, it's more about how you feel in the job than the time you've been there. Do you feel valued by your employer? Respected even? Are you making an impact? Are you learning? Enjoying the challenge? Even content to just cruise? Or are you stifled? Exploited? Bored? Even bitter?
In my experience, it's not hard to know when it's time to move.
However, given how moving I find your username, I want to provide a few heuristics that I've personally found useful.
1. The merry-go-round
If you find yourself in a state of deep ambivalence, you're probably on the merry-go-round. Sometimes, the job is bearable. Other times, it makes you want to jump in front of a car. Try as you might, you stay put as you watch time slip through your fingers like sand. Much like an alcoholic struggling with drinking, you might swear off alcohol one minute just to find yourself drunk on the sidewalk the next minute. The situation is like a curse that you can't break.
2. Coping with burnout
There was this incredible answer to a previous thread, which I share here (https://news.ycombinator.com/context?id=32035364). Once you look past the sarcasm, you can see that a really good point is being made. Not only is it difficult to act like you're not burning out when you are, you feel worse by pretending that things are fine. For that reason, I don't like the phrase, "fake it till you make it". In particular, if you're already mentally ill, smiling through the pain will only worsen the situation.
3. Mysterious culprit
Eastern philosophers are actually very diligent in their studies. They would never celebrate ignorance or apathy. Instead, they would advocate for a rigorous study of the truth, which may or may not yield an action to solve the problem. Because you've given no context, which is fine since you're entitled to privacy, I can only surmise that the truth is either too hard to bear or too difficult to verify. For myself, I find it easy to accept hard truths. The inability to verify something is like a figment of your imagination haunting you. You are so pre-occupied with the belief that the cause of your problem lies in one place, that you'll fail to see the real source of your problems. As the saying goes, if you try the same thing over and over while expecting different results, that is the definition of madness.
There is no silver bullet solution to your problems. You're in a bind, and the way forward will be very painful. Introspection is your greatest tool because trying to control a situation is the fastest way to get sick. Bon chance, mon ami!