3-5 years? Try 1-2.  The reason is that there are a lot of opportunities, and it gets boring to work on the same thing for a long time.  Also you can learn more different things and fill out your resume by changing jobs more often.<p>That said, I personally prefer to stay at a job for at least three years, given the opportunity.