That got me wondering about if it had ever happened before, and if so, when was the most recent case of it? Going back to the start, this is what I found:
Following the convention, we’ll assume Walpole was the first Prime Minister, and thus there was no former one in Parliament during his time in office. Having been created Earl of Orford, he remained in Parliament until his death in 1745, through the whole of the Earl of Wilimgton’s time as PM and the first two years of Henry Pelham’s.
Wilmington and Pelham both died in office, thus there were no living former PMs during the Duke of Newcastle’s first period in office. He was then replaced by the Duke of Devonshire before returning to office when Devonshire resigned. Newcastle was in power till 1762, and Devonshire didn’t die until 1764, then Newcastle lived on until 1768, during which time the Earl of Bute, George Grenville, the Marquess of Rockingham and Pitt the Elder all served as Prime Minister.
Of those four, Bute lived the longest and held a peerage, thus remaining a member of Parliament in the Lords until his death in 1792. There were a number of Prime Ministers during that time, the longest lived being the Duke of Grafton, who survived until 1811. Following him, Henry Addington (who joined the Lords as Viscount Sidmouth after being Prime Minister) lived until 1844.
(EDIT: Charles Dundas in the comments points out that the Earl of Bute was only a member of the Lords until 1780, but Grafton was an ex-PM in the Lords from 1770 until 1811)
Viscount Goderich was the longest-surviving PM of Addington’s time, living till 1859 (and outliving four of his successors), with Lord John Russell (later the first Earl Russell) the longest-lived of Goderich’s time. Russell lived to see Disraeli and Gladstone trade the premiership back and forth, though Gladstone was the longest-lived. However, he did not enter the Lords, and served as an MP until 1895. When Gladstone left Parliament, however, his successor the Earl of Rosebery also lost the Premiership to the Marquess of Salisbury, though Rosebery lived on until 1929.
At Rosebery’s death, David Lloyd George was still in Parliament and would serve as an MP until 1945, while Stanley Baldwin (both a former and future PM at the time of Rosebery’s death) would be in the Lords as Earl Baldwin until 1947. Attlee and Churchill were then both former Prime Ministers and leaders of the Opposition while the other was in office. Attlee would remain in Parliament as Earl Attlee until his death in 1967, and then there would always be at least one former Prime Minister in the House of Lords until Thatcher’s death in 2013.
On her death, Gordon Brown became the only former Prime Minister left in Parliament, and so, to answer my original question, if Cameron remains as Prime Minister and none of the three living former PMs enter the Lords, this will be our first time without a former Prime Minister in Parliament since the Duke of Newcastle’s first term in 1754-56.