The Doctor can go back to Gallifrey & has done so several times. For the most part, however, he prefers not to go there.
There was a period in his life during which he wasn't able to go there. That period lasted from the end of his "War Doctor" incarnation, when he brought an end to the Last Great Time War by hiding Gallifrey in a pocket universe of its own, as shown in "The Day of the Doctor", until (following the planet's return to its proper universe) the Twelfth Doctor went back there at the end of "Heaven Sent". For much of that period, the Doctor believed (for reasons explained in "The Day of the Doctor") that Gallifrey no longer existed.