A lot of Doctor Who episodes are written by "guest writers", which basically just means that they're not regular DW writers. In any case, no matter who writes the episode, whether it's a normal DW writer or not, Steven Moffat, the current Doctor Who showrunner, signs off on the script to ensure continuity (well, as much continuity as one can get in a 48-year-old show) in both the current series and the Whoniverse as a whole.
So The Doctor's Wife was planned into the season by the normal production team; it's just that the script was proposed and written by someone who normally doesn't work in TV. That's fairly common, and doesn't make it different from other TV episodes, since Moffat is the one who oversees and approves the script (and in some cases, he'll rewrite it, although not in this particular case).
Now, the BBC has never issued an official comment on what is canon in the Whoniverse. Many people consider the TV shows and the 1996 movie to be the only canon sources; other people include the novels and other sources as part of canon.1
In any case, the vast majority of people (in fact, as far as I know, everyone) considers the TV show in its entirety to be part of canon. So yes, The Doctor's Wife is canon in the Whoniverse.
If you're curious, here are a list of possible canon sources. It's up to you to decide what you consider canon: The Old Series, the New Series, the 1996 movie, Torchwood, the Sarah Jane Adventures, K-9, the novels, the comics, the other two movies, the Magazine, the audio stories, the computer games, the webcasts, Doctor Who Confidential, Doctor Who and the Curse of Fatal Death (parody but written by Steven Moffat), the DVD extras, the charity scenes, etc...