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 USS Enterprise.
Upon beaming down to the surface, the landing party consisting of Leonard McCoy, Karl Jaeger, and DeSalle discovered an oasis-like conditions – 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. (TOS: "The Squire of Gothos")