Dear Meenu Sachdeva,
As such, bosses are known to be whimsical, and juniors are expected to adjust to their idiosyncrasies. Nevertheless, if a boss has a special bias towards one of the subordinates and is likely to put the junior's career in jeopardy, then the junior must quit the employment. Regarding the length of stay of an employee in a company, there are unwritten rules. If the junior has completed a certain number of years that will not raise doubt in the mind of a future employer, then there is nothing wrong with quitting the employment.
For an average individual, career growth is most important. If the boss is inimical or does not value the worth of the subordinate, then the subordinate should not waste time trying to win the boss's approval. It is important to remember that career growth is crucial. Staying at a particular company or working under a particular boss are just the intervening stages. Any excessive stay in such a company is akin to "flogging a dead horse."
While recommending quitting employment, I do not advise any slackness from the subordinate. He/she must introspect and identify the shortcomings that the boss dislikes. Secondly, the junior employee must devote their body and soul to their work. Thirdly, the subordinate must identify means to improve personal productivity. Finally, the subordinate must demonstrate fierce loyalty to the organization until the last working day.
All the best!
Dinesh Divekar