It's not clear exactly when this Elvish method of accounting time came into use. In Appendix D to The Lord of the Rings, the choice of a period of 144 years to a yén is due to the fact that the Eldar 'preferred to reckon in sixes and twelves as far as possible'. That implies that the yén was derived from a period of 12 x 12 solar years, so that the Sun must have been in existence before the count of yéni began (and thus the first yén came to an end in the year I 144 at the earliest).
Volume 10 of The History of Middle-earth offers a different explanation: that the yén was the Elves' equivalent of the Valian Year, the period used to measure time by the Valar before the rising of the Sun. On that basis, the use of yéni would have dated back much further, and may even have been reckoned back to the beginning of Arda itself. This calculation belongs to a developing later conception that would have a far-reaching effect on dating of ancient events (Valian Years are elsewhere said to have only a little under ten solar years in length) and doesn't appear to have been fully integrated into Tolkien's legendarium.