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 if he/she is likely to put junior's career into jeopardy, then the junior must quit the employment. As far as the length of the stay of an employee in a company is concerned, there are unwritten rules. If the junior has completed a certain number of years that will not raise the doubt in the mind of the future employer, then nothing wrong to quit 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 his/her time in winning the mind of a boss. Let it be kept in mind that career growth is important. Staying at a particular company or working under a particular boss are just the intervening stages. Any excess stay in such a company is akin to
flogging a dead horse.
While recommending to quit the employment, I do not recommend any slackness from the subordinate. He/she must do introspection and identify the shortcomings that the boss dislikes. Secondly, the junior employee must devote his/her body and soul to his/her work. Thirdly, the subordinate must identify means to improve personal productivity. Finally, the subordinate must demonstrate fierce loyalty to the organisation till the last working day.
All the best!
Dinesh Divekar