The Conservative Party leader said the country needed fresh leadership after 17,410,742 people voted UK leave EU, compared with 16,141,241 for remain.
He will stay as Prime Minister in the short term but said a new leader should be in place by October.
In a speech outside 10 Downing Street, Mr Cameron said: "The British people have voted to leave the EU and their will must be respected.
"Across the world people have been watching the choice that Britain has made. This will require strong, determined and committed leadership.I am very proud to have been Prime Minister of this country for six years."
""I think the country requires fresh leadership. I do not think I can be the captain to take the country to its next destination."
"In my view I think we should have a new Prime Minister in place by the start of the Conservative conference in October."
In Sheffield, the 'Leave' campaign got over the line by just 6,000 votes - 51 per cent of the total vote. Voter turnout was 67.3 per cent.
Elsewhere, in Barnsley it was 68.3 per cent for leave and 31.7 per cent for remain; Rotherham 67.9 per cent for leave, 32.1 per cent for remain; Doncaster 69 per cent for leave, 31 per cent for remain.
Voter turnout: Barnsley 69.9 per cent, Rotherham 69.5 per cent, Doncaster 69.5 per cent.
England voted leave by 53.4 per cent, Wales to leave by 52.5 per cent, Scotland to remain by 62 per cent, Northern Ireland to remain by 55.8 per cent.
The official result follows a snap poll by The Star earlier this week revealed nearly two-thirds of readers indicated they would vote leave. More than 1, 600 votes were cast.
UK PM David Cameron Resigns As Britain Leaves EU
Sheffield residents had expressed divided views. Many backing the remain camp raised concerns about travel, the economic uncertainty of a leave vote and trade agreements.
Those in favour of Brexit spoke of immigration, the state of the NHS and keeping money we send to the union in Britain, The Star reported.
12