Plato and Aristotle wrote about it, and it’s in texts like the Symposium. But it wasn’t universal, and different city-states had different laws regarding what was allowed. Adults were not permitted to have sex with males under 18, as it was only permitted between an adult and an eromenoswas (a male between the age of 18-20.)