The Doctor didn't destroy Gallifrey or kill off the Time Lords, although he believed for a long time that he had done so.
After the Dalek fleet surrounded Gallifrey, the Time Lords -- led by Rassilon -- decided to implement the "Ultimate Sanction", as revealed in "The End of Time". This would have destroyed everything except the Time Lords themselves. They would have "ascended" to become beings of "consciousness alone", as Rassilon expressed it. When the Doctor, in the incarnation known (out of universe) as the "War Doctor", learned of these plans, he decided that the Time Lords threatened the entire universe even more than the Daleks did and he had to stop them.
As seen in "The Day of the Doctor", after the fall of Arcadia (Gallifrey's second city) to the Daleks, the Doctor stole a weapon called the Moment. This weapon, which was also known as "the Galaxy Eater", was the only one of the "forbidden" weapons from the Time Lords' Omega Arsenal that hadn't already been used in the Time War. The Doctor intended to use the Moment to destroy both Gallifrey and the Daleks in order to end the Last Great Time War, and save the rest of the universe.
The Moment was so sophisticated and powerful a weapon, however, that it had developed a conscience. It sought to persuade the "War Doctor" to find another way of ending the Time War and it brought him help to do so: the Tenth & Eleventh Doctors and Clara Oswald.
Between them, they devised a way to make it appear that the Moment had been used and that Gallifrey had been destroyed, while actually freezing the whole of Gallifrey in a pocket universe. Doing this required thirteen incarnations of the Doctor -- the First to the Eighth, the "War Doctor" and the Ninth to the (future) Twelfth -- using thirteen instances of the TARDIS.
Because the Dalek fleet surrounded Gallifrey and was firing continuously on the planet at the instant it was removed from the main universe, the Daleks destroyed themselves almost completely and created a convincingly vast explosion that made it look as if Gallifrey had been destroyed, too.
Unfortunately, because the Doctor had crossed his own timeline, only the Eleventh and later Doctors (and Clara) could remember that Gallifrey had been saved. The "War Doctor" and the Ninth & Tenth Doctors remembered deciding to use the Moment and remembered both Gallifrey and the Daleks vanishing in a huge explosion, so they believed that they really had destroyed "Daleks and Time Lords alike". The Eleventh Doctor also believed this, up until his participation in the events of "The Day of the Doctor".