It is a difficult balance to strike. I think an average of 2-3 years per company shows that you lasted long enough that you weren't rubbish and contributed to the company.
Pretty much the norm in IT is:
0-2 yrs - lower level chopping and changing or culture/general mismatch
2-3 yrs - pretty much the norm, usually where policy changes annoy people, growth/direction changes, slight direction change in career
3-5 yrs - Boredom, growth change, role change, where people leave to do something else on a higher level
5-7 yrs - spin off their own thing, management jump/change in career
Exception is lately people prefer to be speciality devs and remain as senior or architect/core people for longer. This wasn't always the case a few years back but times be changing and quality devs don't grow on trees so this happens a lot these days across speciality fields in SA btw(eng, it).
Personally I hate that industry, particularly SA is geared towards the 0-2yr hop for the 1st 1/2 decade give or take and most recruiting people will see it as the norm until you in industry for about 5-7 yrs.. By then u need to have been in a company for at least 3+ years minimum or else are considered a hopper/unstable person (then you better off being in a consultant assuming you amassed sufficient experience in a sector e.g. Finance, telecoms, defense etc yes I know IT is IT but really it isn't).
For me it's tough as I've been changing industry & job function continually but what I found interesting the other day was this.. I started off with a 8k salary and despite being unemployed (with trade & industry restraints) for 6-8 months.. If I calculated annual increase at 11% per anum for the period I still work out to be in a lot better position than I would be. If I take into account position I was barred from getting I'm on par. (Not accounting for accrued values)
So that kinda gives me hope, still long way to go vs age and graduating date (find a job as a grad in cpt with 0 exp during recession.

1.5 yrs of life gone)