Aristotle reasoned that a fifth element must be added to these four to explain the behaviour of the heavenly bodies. Whereas the terrestial elements of earth, water, air, and fire were all mutable and corruptible, coming into being and passing away, no change could be perceived in the celestial realm. Moreover, while the natural motion of the four terrestrial elements was towards or away from the centre of the cosmos in a straight line, the natural motion of the heavenly bodies was uniform circular motion around that centre. Aristotle therefore inferred that the cosmos above the terrestrial sphere (that is, from the moon upwards) was not made out of any of the mutable terrestrial elements but must be composed of a different, unchangeable substance, the fifth element or 'quintessence', which he called aether (αἰθήρ).
The place of these five elements in ancient and medieval cosmology can be see in this image from the standard textbook on the subject, the Tractatus de sphaera (c. 1230) of Johannes de Sacrobosco (c.1195–c.1256), here in an Italian translation from 1537.
At the centre of this cosmology is the earth (Terra, consisting of the three continents, Evropa, Africa, and Asia). Aroung the earth are the spheres of water (Agva, corresponding to the oceans and other bodies of water), air (Aria), and fire (Fvoco).
Above the spheres of the four terrestrial elements come the spheres of each of the seven ancient planets, each with its sign: 1. ☾ the Moon, 2. ☿ Mercury , 3. ♀ Venus , 4. ☉ the Sun , 5. ♂ Mars , 6. ♄ Jupiter , and 7. ♃ Saturn. Above these are 8. the firmament or sphere of the fixed stars (with the signs of the zodiac), 9. the crystalline sphere, and 10. the 'primum mobile' or prime mover, which sets all the othersin motion.
These five elements have been associated since Plato's Timaeus with the five platonic solids. They were also known to the pre-Socratics, and have close parallels in ancient India, China, Tibert, and Japan.
Further resources. For Aristotle's views: G.E.R. Lloyd, Aristotle: The Growth and Structure of his Thought (Cambridge, 1968), pp. 133-9. A summary of Sacrobosco's De sphaera is available on the Starry Messenger website in Cambridge. The complete treatise in English translation is available here.