There is no hard and fast rule that defines how long you should stay at first job. But it’s good to stay in your first organization at least for minimum 3 years and gain the skill sets. Your first job helps you to understand many things, what's organization, business process, team work, customer's expectations, meeting deadlines, performance reviews, technology, product development cycle, TTM etc.
Many of the fresher focus only on technology and they are very keen on improving their technical skills. Once they gain the technical skills and project experience, they immediately plan to change the organization for small benefits. But they fail to understand that one must understand the complete business process to grow further and reach senior positions.
At senior level postions, one needs to own the complete product development [RTL/Verification/Synthesis/DFT] or business process and drive the team to achieve the business objectives. Staying in an organization for a considerable time helps you to gain the confidence and take the ownership.
I have seen some people who stay in the company for more than 10 years also. Why you really need to change the organization when you can learn, earn and grow fast? People want to stay at good organizations that care about the employee growth.