De Blasio made the announcement on MSNBC's Morning Joe and in an op-ed for NBC News.
De Blasio said he feels he's contributed all he can "to this primary election".
"Part time Mayor of New York City, @BilldeBlasio, who was polling at a solid ZERO but had tremendous room for growth, has shocking dropped out of the Presidential race". "But our fight on behalf of working people is far from over".
The mayor's own wife told reporters earlier this year that the timing was "not exactly right" for a campaign, but launch a campaign to become president of the United States of America de Blasio did.
He qualified for the first two rounds of debates but failed to make the September debate stage and appeared unlikely to qualify for the October debates.
"The Mayor seems hell-bent on providing donors with a backdoor to his administration, repeatedly undermining his own moral authority as the leader of this city", said Susan Lerner, executive director of government watchdog group Common Cause's NY chapter.
De Blasio struggled to gain traction in a sprawling field of Democrats seeking the presidency.
As Politico noted, back in 2013 Trump, then a private citizen, had said that he thought de Blasio would "end up being a good mayor".
Donald Trump is not the only New Yorker to balk at the mayor's candidacy - over 75 percent of respondents in one poll told him not to run - which has consumed much of his energies and left little time to fulfill mayoral duties.
Over the past weeks, de Blasio said he was eyeing the polls for any changes that might give him a reason to keep going. "That can happen for our country, too", de Blasio said in his campaign roll-out in May.
"We were watching the polling to see if anything was moving and it just wasn't moving", he said.