I seem to remember an article (or I did the math) that shows that it's financially best to pursue a new job in the tech industry every 2.5 years.
It's enough time to get value from meeting new peers and make valuable contributions that they will remember but not short enough that they will view you as someone who's continually job shopping.