In 2267, when the USS Enterprise was first intercepted by this body, it was eight days distant from Beta VI at warp factor three and Earth was 900 light years away. Gothos had no primary and a variable spatial position.
The normal surface of the planet had no detectable soil or vegetation, an extremely hot, toxic atmosphere swept by tornadic storms, and continuous volcanic action – deadly to terrestrial and most other sorts of life without oxygen and life support.
In reality, Gothos was artificially constructed by the entity Trelane sometime around 2267. Trelane manufactured the world, and various artifacts on it, for the purpose of interacting with individuals kidnapped from the Enterprise. Because Gothos was 900 light-years from Earth; Trelane viewed it as it was in the 14th century.
Upon beaming down to the surface, the landing party consisting of McCoy, Jaeger, and DeSalle discovered an oasis-like condition – flourishing vegetation, standard Earth atmosphere, and a large castle-like structure, all manufactured by Trelane.
Although most of Trelane's tricks were accomplished with the help of his mirror machine, a "medium of instrumentality," Spock theorized that the local conditions were maintained by a different machine – a machine too large to fit within Trelane's home. Evidently, this was true, since the atmospheric conditions persisted after Kirk destroyed the mirror machine.
Trelane was able to move Gothos at speeds fast enough to outpace the Enterprise's flight. The method used to accomplish this was not revealed, but the planet was sufficiently maneuverable to thwart standard evasive tactics. After Trelane's parents said it was time to come in, they told Kirk they would sustain the planet's life support conditions before he left. (TOS: "The Squire of Gothos")