IMDB lists one filming location
Black Hangar Studios, Hampshire, England, UK
However, the Heaven Sent Wikipedia Entry adds
Filming for the Castle interior scenes took place in Cardiff Castle and Caerphilly Castle, in addition to constructed sets
And further links to Notes on Heaven Sent.