He will be replaced by 'Broadchurch' creator Chris Chibnall.
Steven Moffat is leaving 'Doctor Who'
A 'Doctor Who' Christmas special will air later this year, while series 10, Moffat's last, is scheduled to be broadcast in 2017, with a new companion on board to replace Jenna Coleman.
Chibnall will begin his tenure as executive producer of 'Doctor Who' in 2018.
Moffat said: "Feels odd to be talking about leaving when I'm just starting work on the scripts for season 10, but the fact is my timey-wimey is running out."
He added: "While Chris is doing his last run of 'Broadchurch', I'll be finishing up on the best job in the universe and keeping the Tardis warm for him.
"It took a lot of gin and tonic to talk him into this, but I am beyond delighted that one of the true stars of British television drama will be taking the Time Lord even further into the future."
Moffat joked: "At the start of season 11, Chris Chibnall will become the new showrunner of 'Doctor Who'. And I will be thrown in a skip."
Chris Chibnall is the new boss of 'Doctor Who'
Chibnal said: "Doctor Who is the ultimate BBC programme: bold, unique, vastly entertaining, and adored all around the world.
"So it's a privilege and a joy to be the next curator of this funny, scary and emotional family drama.
"I've loved 'Doctor Who' since I was four years old, and I'm relishing the thought of working with the exceptional team at BBC Wales to create new characters, creatures and worlds for the Doctor to explore."
The 'Broadchurch' boss also paid tribute to Moffat.
"Steven's achieved the impossible by continually expanding Doctor Who's creative ambition, while growing its global popularity," he said.
"He's been a dazzling and daring showrunner, and hearing his plans and stories for 2017, it's clear he'll be going out with a bang. Just to make my life difficult."
Controller of BBC One Charlotte Moore said: "I want to thank Steven Moffat for everything he has given 'Doctor Who'. I've loved working with him, he is an absolute genius and has brought fans all over the world such joy.
"I will be very sad to see him leave the show, but I can't wait to see what he will deliver in his last ever series next year with a brand new companion.
"I would also like to take this opportunity to welcome Chris Chibnall, a wonderfully talented writer who I know will bring something very special to the hit series."
There will be no series of 'Doctor Who' this year
Moffat took over 'Doctor Who' in 2010 and during his tenure, the show has grown into a global success.
Moffat was also at the helm for the 50th Anniversary special in 2013 which saw fans around the globe celebrate the world's longest running sci-fi series with Doctors, Matt Smith, David Tennant and John Hurt fighting the Daleks in a feature length episode.