A light-year is one of the most common distance units in astronomy. Despite its name, it does not measure time. It measures how far light travels in one year.
A light-year measures distance, not time
Light moves at about 300,000 kilometers per second in a vacuum. Over one year, that speed adds up to an enormous distance: roughly 9.46 trillion kilometers.
So when astronomers say a star is ten light-years away, they mean its light must travel for about ten years to reach us.

Why astronomers use light-years
Distances inside the Solar System are already large, but distances between stars are vastly greater. Writing those values in kilometers produces strings of numbers that are difficult to compare.
Light-years make those scales easier to understand. They also connect distance directly with the travel time of light.
Looking into space means looking into the past
Because light takes time to travel, every astronomical observation shows an object as it was when that light left it. The Moon is seen a little over a second in the past, the Sun about eight minutes in the past, and distant stars years or centuries in the past.
For galaxies millions or billions of light-years away, telescopes become tools for studying ancient stages of the universe.

Useful examples of cosmic distance
The nearest star system beyond the Sun is a little over four light-years away. The Milky Way spans roughly one hundred thousand light-years, while the Andromeda Galaxy is about 2.5 million light-years from us.
These examples show why ordinary units become inconvenient so quickly once we leave the Solar System.
A light-year is huge, but space is much larger
A single light-year feels unimaginably large on human scales, yet galaxies are tens of thousands of light-years across and the observable universe spans billions of light-years.
Astronomers also use parsecs and megaparsecs, especially for professional measurements, but light-years remain one of the easiest units for beginners to visualize.
FAQ
Is a light-year a unit of time?
No. It is a unit of distance based on how far light travels in one year.
Why does looking far away mean looking into the past?
Because light needs time to cross space before reaching our eyes and telescopes.
How far is one light-year?
About 9.46 trillion kilometers.