The prayer's history is longer than its text, and the two should not be conflated.
Elements are in the Egyptian desert literature of the fourth and fifth centuries, where the monastic sources discuss short repeated prayers, monologistos, as an aid to unceasing prayer, without giving this wording. Repeated invocation of the name of Jesus is discussed by writers of that period and after. The fixed form, and above all the physical technique of breathing and posture, belong to later Byzantine sources: Symeon the New Theologian and the fourteenth-century hesychast writers, whose defence by Gregory Palamas against Barlaam of Calabria is the theological centrepiece.
The Philokalia, compiled in 1782 by Nikodimos of the Holy Mountain and Makarios of Corinth, gathered this literature and was translated into Slavonic and then Russian, which is how it reached Russian monasticism and, through it, the wider world.
The reason most Western readers know the prayer at all is a single anonymous nineteenth-century Russian book, The Way of a Pilgrim, in which a wanderer learns the prayer, recites it thousands of times daily, and finds it praying itself. It is a work of spiritual literature, its authorship and provenance are uncertain, and it is not a manual.
Orthodox writers warn repeatedly against taking up the breathing technique without a spiritual father. The caution is about method and about the psychological risks of intensive practice; the words themselves are entirely public, printed in every prayer book, and nothing about them is withheld.