He said he did not want to be a distraction and that he was "sorry he had hurt people".
The choice of Hart for host was only announced on Tuesday.
But tweets from a decade ago emerged of apparent anti-gay slurs, sparking calls for the Academy of Motion Picture Arts and Sciences to drop him.
Kevin Hart had said hosting the Oscars was "a goal on my list for a long time".
But in a tweet late on Thursday, he said he had chosen to step down "because I do not want to be a distraction on a night that should be celebrated by so many amazing talented artists".
He said: "I sincerely apologise to the LGBTQ community for my insensitive words of the past."
Comments Hart made during a comedy routine in 2010 have been put under the spotlight in recent days.
"One of my biggest fears is my son growing up and being gay. That's a fear," he told the audience.
"Keep in mind, I'm not homophobic, I have nothing against gay people, be happy. Do what you want to do.
"But me, being a heterosexual male, if I can prevent my son from being gay, I will."
In 2015, by which time his profile had risen significantly, Hart addressed the comments in an interview with Rolling Stone.
"I wouldn't tell that joke today, because when I said it, the times weren't as sensitive as they are now," he said.
"I think we love to make big deals out of things that aren't necessarily big deals, because we can."