As permanent secretary, he led the Treasury's response to the 2007 credit crunch and the 2008 banking crisis.
Prior to that, he served as principal private secretary to two chancellors, Ken Clarke and Gordon Brown.
Current Chancellor George Osborne said he had been "one of the outstanding public servants of his generation".
The Treasury said the process for selecting his successor would be announced "in due course".
The most senior civil servant at the Treasury, Sir Nicholas Macpherson, is to step down in March following more than a decade in the role.