On the penultimate weekend before the crunch vote, Mr Cameron has used a series of newspaper articles and a BBC interview to warn of the financial consequences of Brexit, saying it could put at risk ring-fenced future funding for public services.
Trade and economy
How trade and the UK's economy are affected by membership of the EU.
What the leave and remain sides are saying about trade and the economy in the #EUref campaign
About half of UK overseas trade is conducted with the EU
The EU single market allows the free movement of goods, services, capital and workers
Trade negotiations with other parts of the world are conducted by the EU, not individual member states
UK companies would be freed from the burden of EU regulation
Trade with EU countries would continue because we import more from them than we export to them
Britain would be able to negotiate its own trade deals with other countries
Brexit would cause an economic shock and growth would be slower
As a share of exports Britain is more dependent on the rest of the EU than they are on us
The UK would still have to apply EU rules to retain access to the single market
EU referendum issues guide: Explore the argumentshttp://www.bbc.co.uk/news/uk-politics-eu-referendum-36027205http://www.bbc.co.uk/news/special/2016/newsspec_13606/content/iframe/english/index.inc.app.htmlExplore all the issuesChoose an issue:What both sides are sayingAll issuesMain viewsShare this pageEU referendum issues guideWhat the leave and remain sides are saying in the #EUref campaign
He said forecasts from the Institute for Fiscal Studies suggested Brexit could lead to a shortfall in the public finances of between £20bn and £40bn which would need to be "filled" - either by tax rises, extra borrowing or spending cuts.
In their 2015 election manifesto, the Conservatives promised to extend the so-called triple lock on state pensions, a guarantee that they rise every year by at least 2.5% - or the rate of inflation or growth in earnings if it is higher - until 2020.
While pensioner benefits were a "policy priority" and he was committed to honouring manifesto promises, the PM said £90bn was spent on it every year and it was among many existing commitments that might have to be re-examined in a post-Brexit climate.
"Our pensions promise is based on a growing and succeeding economy," he said. "All the experts... agree that if we leave the single market, if we cut ourselves off from the most important market, our economy would be smaller and that has consequences.
"We would be taking a risk with growth, with jobs and with pensions. We shouldn't do that - it is the wrong choice."
Analysis by Ben Wright, BBC political correspondent
A "very lively debate" was how David Cameron described this too-close to call referendum - an understated description of a vote that will determine the country's future and his own.
Immigration is one of the issues galvanising Vote Leave supporters. Today David Cameron tried to make the economic risks of Brexit just as visceral.
The prime minister warned a vote to leave the EU would lead to "self-inflicted recession" and a huge hole in the public finances.
Older voters are more likely to vote than other age groups - and, it is thought - lean heavily towards Leave. The Remain campaign wants them to think again and Mr Cameron said it would be "very irresponsible" for him not to make the economic risks of leaving the EU clear.
But Conservative ministers in the Leave campaign accused him of undermining the party's own manifesto promise on pensions while the UKIP leader Nigel Farage dismissed the Remain campaign's warnings as a "daily prophet of doom".
In the final days of this campaign senior Labour figures fighting for Remain will try to convince their party's traditional supporters to stick with the EU - voters both sides know could swing this referendum.
While he would "carry out" the people's instructions if they voted to leave on 23 June, Mr Cameron said two years of exit negotiations would "suck the energy out of the government and our country when we should be taking on the world and winning".
And he declined to say whether, while remaining as prime minister after a Leave vote, he would implement Vote Leave's plans for an Australian-style points-based immigration system and other proposals, such as cuts to VAT on household energy.
"If we vote to leave, will I carry on as prime minister? Yes. Will I construct a government which includes all the talents of the Conservative Party? Yes. Do I think it is the right course for our country? No I don't."
'Fear on steroids'
Meanwhile, Chancellor George Osborne said the armed forces could see their budgets slashed by £1bn-1.5bn a year, telling the Sun on Sunday that Brexit would mean "a new dose of austerity, more years of public spending cuts".
He said: "If we leave the European Union, Britain is smaller and so Britain's armed forces will be smaller and that means fewer planes and ships and personnel to defend us."
But pro-Brexit ex-cabinet minister Iain Duncan Smith accused his party leader of a "vindictive and desperate attempt to bully and frighten the British people".
"This is a baseless threat," he said. "The truth is that these are policy choices and the Conservative manifesto said that protecting pensioners was a priority.
"It is now apparent that there is nothing they will not use or jettison in their efforts to keep us in the European Union."
Employment minister and Leave campaigner Priti Patel told 5 live's Pienaar's Politics it was an example of the politics of fear "on steroids".
And UKIP leader Nigel Farage suggested that voters did not take kindly to being threatened, telling Andrew Marr that if the pound fell slightly after Brexit, "so what?" - since it was a floating currency and exports would benefit.
"People have had enough of being threatened by the prime minister and the chancellor," he said.
Amid reports Remain wants Labour to take the lead over the next 10 days to shore up support among their supporters and undecided voters, Gordon Brown has said the opposition will put forward detailed proposals to help communities cope with high levels of immigration.
"It is time now for us to step our efforts up," the former prime minister told Dermot Murnaghan on Sky News. "We have got to show people the positive benefits - that you are not voting for the status quo, you are not voting for insecurity."