The prime minister said the country required "fresh leadership" to "steer the country" out of the EU.
Also Read: #Brexit: Britain votes to leave EU divorce of 43 years marriage is historic
He promised to "steady the ship" over the coming months before stepping down in October.
Mr Cameron was close to tears as he announced his decision outside Downing Street.
The referendum, called by Mr Cameron, delivered a shock victory for the Leave campaign.
The Brexit vote immediately sent the pound tumbling and sparked calls for the prime minister's resignation.
Mr Cameron said the result was the "will of the British people" which was an "instruction which must be delivered"