He was dead between Last of the Time Lords and End of Time, and he never had a fully working TARDIS before that, so it must happen after he gets sucked into the Gallifrey Time Lock at the end of End of Time Part 2. Presumably he leaves Gallifrey when it escapes the time lock/pocket dimension/wherever it is. Has…