Of the postwar PMs...
Attlee continued to lead Labour until the Party's defeat in the 1955 election, after which he resigned his seat following elevation to the peerage.
Haven't Attlee decided to stay on for so long (having led the party for twenty years, after all) mostly to prevent Morrison from having a chance to succeed him?
Major always struck me as somebody with an incredibly speed political rise. He was an MP for mere 10 years before becoming the PM, and cabinet member for just three years (including like one and a half on actual senior ministerial position). And, when he retired as PM, his service was just about 22 years.
I don't think any of modern PM's had such a rapid rise, aside from Cameron (elected in 2001, and never served in the cabinet).