The longest I've been at a place has been 2.5 years. I find that I'm usually itching to get out around after the 2 year mark due to various reasons like boredom from doing mostly the same thing over and over, lack of change in environment, no new challenges, people I know having mostly left/transferred to better places.