A Conservative leadership race will take place this summer and a new prime minister will be in place in time for the Tory party conference in October.
Johnson publicly announced his resignation outside No 10 Downing Street just after 11.30pm New Zealand time.
He said it was "clearly now the will of the parliamentary party" for there to be a new prime minister.
"I want you to know how sad I am to be giving up the best job in the world," Johnson said.
"But them's the breaks."