Educated at Harrow School and Trinity College, Cambridge, Pepys was called to the bar of Lincoln's Inn in 1804.
He sat in Parliament successively for Higham Ferrers and Malton, became Solicitor General in 1834 and Master of the Rolls in the same year.
On the formation of Lord Melbourne's second administration in April 1835, the great seal was in commission for a time, but Cottenham, who had been a commissioner, was eventually appointed Lord Chancellor in January 1836 and at the same time was raised to the peerage as Baron Cottenham of Cottenham in the County of Cambridge.
He died at Pietra Santa, Lucca in the Italian Grand Duchy of Tuscany in April 1851,[3] aged 70, and was succeeded by his eldest son, Charles, who was at the time Clerk of the Crown in Chancery.
[6] Lady Cottenham died in April 1868, aged 66 at The Cedars in Sunninghill, Berkshire.