I've heard it as a rumour from a few friends, but can this really be happening? Is there a trustworthy source that validates this claim? Also, why is he leaving, and who is to replace him? I'm rather concerned for the well-being of one of my favorite TV shows.
Yes, Moffat is leaving Doctor Who at the end of 2017.
From this article officially released by the BBC itself:
The head writer and executive producer of Doctor Who, Steven Moffat, is to step down from the show, the BBC has confirmed.
His last series will go out in spring 2017 following a Christmas special, after which he will be replaced by Broadchurch writer Chris Chibnall.
"At the start of season 11, Chris Chibnall will become the new showrunner of Doctor Who. And I will be thrown in a skip."
This article from Cinema Blend confirms that Moffat will stay for the 2017 Christmas special as well as the preceding Series 10:
Steven Moffat has been the showrunner on Doctor Who since 2010, but the long-running series is about to go through a slew of changes. Not only is current lead Peter Capaldi getting a brand new companion in Pearl Mackie during Season 10, but Steven Moffat is also preparing to step down as the showrunner on the series. Now, we finally know when the changeover is going to take place, but it looks as if it won’t happen for a while, yet. Steven Moffat just confirmed he will not be stepping down as soon as Season 10 ends. Instead, he will stick around for the Christmas special in 2017, as well.