Light travels at 3.00 x10^8 meters per second and the average distance from the sun to the earth is 1.46 x10^11 meters, so the time it takes light to reach us from the sun is:
(1.46x10^11 meters)/(3.00 x10^meters/sec) x (1 min/60 sec) = 8.11 minutes
So we're seeing light that was produced by the sun just 8 minutes and a few seconds ago.
Light from the nearest star outside our solar system, Alpha Centauri, takes about 4.3 years to reach us and light from very distant stars can take millions of years. The light year is a unit of distance measurement that is stated in terms of how long it takes light from an object to reach Earth, for example Alpha Centauri is 4.3 light years away.
When we see light from a distant star we are looking into not our past but the star's past. The light that just reached us was given off by nuclear processes that occurred years ago in the star. Astronomers are able to gain information about the age and composition of a star by analyzing its spectrum (wavelengths of light given off.)