A light-year is a unit of distance, not time, defined as how far light travels in a vacuum over the course of one year. Since light moves at about 300,000 kilometers per second, a single light-year works out to roughly 9.5 trillion kilometers, a number too large to comfortably use kilometers or miles for.
Astronomers use the light-year because ordinary distance units quickly become unwieldy at cosmic scales. The nearest star system to our sun, Alpha Centauri, sits about 4.2 light-years away, while our entire Milky Way galaxy stretches roughly 100,000 light-years across.
Because light takes time to travel, looking at distant objects also means looking back in time. A galaxy that is 10 million light-years away is being seen as it looked 10 million years ago, not as it looks right now, since that is how long its light took to reach us.