Mrs Cameron gave an emotional speech in which she said that "what people don't realise is just what happy times the last six years have been".
Hammond, who believes in prudent public finances, had been fiercly critical of the European Union in the past but backed Britain's membership in the referendum campaign. May was named head of the governing Conservative Party on Monday after a welter of rivals fell away, setting the stage for her to assume the prime minister's post.
Replying to Labour leader Jeremy Corbyn, who is facing his own leadership challenge, Cameron poked fun at Labour's leadership turmoil, noting that the Tories had had "resignation, nomination, competition and coronation" while Labour is still working out the rules for its contest.
He received a standing ovation after he answered Prime Minister's questions for the last time in the House of Commons.
She acknowledged that Britain faces a rocky road ahead as it undoes 43 years of European Union ties and forges a new relationship with its neighbors.
He wrote to the prime minister yesterday: "The outcome of the United Kingdom's referendum has created a new situation which the United Kingdom and the European Union will have to address soon".
Britain readied itself on Wednesday for a new prime minister as Theresa May prepared for a summons from the queen and David Cameron was poised for his valedictory appearance as the nation's leader in Parliament. She will also attempt to unite a fractured nation in which many, on the evidence of the referendum, feel angry with the political elite and left behind by the forces of globalisation. "We will do everything we can to help anybody, whatever your background, to go as far as your talents will take you", May said, in language more often used by left-of-center politicians, rather than by members of the center-right Conservative Party. He and five other cabinet members were announced today by Prime Minister Theresa May.
The most notable was former London Mayor Boris Johnson, who was given the meaty job of foreign secretary, Britain's top diplomatic post.
Women are expected to secure several top jobs in May's cabinet, including current energy minister Amber Rudd and worldwide development minister Justine Greening.
Later, in a brief speech on Downing Street, the 49-year-old Cameron defended his government's legacy.
May, former home secretary, is Britain's second female prime minister after Margaret Thatcher, who ran the country between 1979 and 1990.
He is expected to make a statement in Downing Street highlighting how he has overseen Britain's economic recovery, before heading to Buckingham Palace to offer his resignation.
In the traditional change of government ceremony, Cameron met the queen at the palace and recommended that the monarch invite May his successor as Conservative Party leader to form a new government.
May campaigned for the leadership as a safe pair of hands, after spending six years as home secretary, one of the toughest jobs in British politics.
The financial markets will be watching May's first days in office closely but with greater optimism as the value of the pound, which fell by up to 15 percent against the dollar after the Brexit vote, has rallied in recent days. Since the vote, she has repeatedly said that "Brexit means Brexit" and her backers say she is determined to make the exit a success.
Not all believe her. As May spoke in front of her new residence, a small band of pro-Brexit demonstrators down the street chanted "Theresa May, don't delay!" But she is likely to come under pressure from European leaders across the English Channel and from Brexit advocates at home to accelerate that timetable.
"I have experienced a man who is serious, who is a fan of no-nonsense policy and who was delivering at each and every moment when things started to become serious", Juncker said.
In the morning, then-Prime Minister David Cameron stepped out on his way to a session of Prime Minister's Questions in Parliament, where he was joined by his wife and three children.
On Thursday, the Bank of England will announce whether it will cut interest rates for the first time since March 2009 to curb the economic fall-out from Brexit.
"I will miss the roar of the crowd, I will miss the barbs from the opposition, but I will be willing you on".
After warm tributes from MPs from all parties, Mr Cameron ended his farewell by telling the Commons: "I was the future once".