I think the career length mainly depends on ...
1. your luck!!!

(you won't survive if you're not lucky with air attacks)
2. the realism setting you use for the game
3. your general experience with sub sims
4. your mental and physical state (a drunk kaleun will never live long, except for Brag, maybe

)
Well, I wasn't lucky enough so far. I always get killed by aircraft.
My longest career lasted till the end of 1941, where I was attacked by an aircraft and torn to pieces.
The really bad thing was that I was already returning to home port (less than 30 km to go).
Thniper