Speaking of it, the unit of light years appears in 1830 s.
The concept of "light year" can only appear on the premise that the speed of light is limited and accurately measured. It is impossible to have the concept of "light year" before we know the speed of light propagation. So when did people measure the speed of light?
Before 1676, it was generally believed that the propagation of light did not take time. 1676, a Danish scientist, O.C. Romer, first put forward the hypothesis that the propagation of light takes time through the observation of Jupiter's moon-eclipse satellite. Then in 1675, the French astronomer Cassini began to imagine that the propagation of light took time. But it was not until the first half of18th century that the mainstream scientific community gradually accepted that the speed of light was limited.
1728, the British astronomer Bradley James gave a method to measure the speed of light, and concluded that the speed of light was about 30 10000 kilometers per second. 1838, German astronomer frederick william bessel first used the word "light year" as the astronomical unit of measurement. He measured that the distance between Cygnus 6 1 and the earth was 10.3 light years.
Since then, astronomers have started to use light years.