The actor, who first stepped into the Tardis in 2013, announced he will bow out in this year's Christmas special.
The 58-year-old was handed the role less than four years ago when he replaced Matt Smith.
The Glasgow-born actor, who was previously best known for playing spin doctor Malcolm Tucker in the BBC sitcom The Thick Of It, insisted only last month that he hoped to continue as the Doctor "for a long time."
But he has faced persistent rumours that he would be leaving to coincide with writer and executive producer Steven Moffat's forthcoming departure from the show.
Capaldi, who made the announcement on Jo Whiley's BBC Radio 2 show, said: "One of the greatest privileges of being Doctor Who is to see the world at its best.
"From our brilliant crew and creative team working for the best broadcaster on the planet, to the viewers and fans whose endless creativity, generosity and inclusiveness points to a brighter future ahead.
"I can't thank everyone enough. It's been cosmic."
The actor has announced his departure ahead of the 10th series of the relaunched show, with 12 episodes starting at Easter.
Paisley-born Moffat said: "For years before I ever imagined being involved in Doctor Who, or had ever met the man, I wanted to work with Peter Capaldi.
"I could not have imagined that one day we'd be standing on the Tardis together.
"Like Peter, I'm facing up to leaving the best job I'll ever have, but knowing I do so in the company of the best, and kindest and cleverest of men, makes the saddest of endings a little sweeter.
"But hey, it's a long way from over. Peter's amazing, fiery, turbulent Doctor is still fighting the good fight, and his greatest adventures are yet to come."
Charlotte Moore, director of BBC content, said: "Peter Capaldi will always be a very special Doctor to me; his adventures through time and space started just as I arrived on BBC One.
"He has been a tremendous Doctor who has brought his own unique wisdom and charisma to the role.
"But, it's not over yet - I know the next series is going to be spectacular."