Visible light can travel indefinitely in a vacuum without losing its energy. Unlike some other forms of radiation, visible light does not decay or lose energy over long distances in a vacuum. It will continue to propagate until it interacts with matter or is absorbed by a surface.
However, it's worth noting that the intensity of light diminishes as it spreads out over larger distances. This phenomenon is known as the inverse square law, which states that the intensity of light decreases proportionally to the square of the distance from the source. So while light does not lose its energy in a vacuum, its intensity becomes progressively weaker the farther it travels.
In terms of time, light travels at approximately 299,792 kilometers per second (or about 186,282 miles per second) in a vacuum. At room temperature, light would travel the same distance it would in any other conditions. The time it takes for light to travel a certain distance can be calculated using the equation:
time = distance / speed of light
For example, if you wanted to know how long it takes for light to travel 1 kilometer at room temperature, you would divide the distance (1 kilometer) by the speed of light (299,792 kilometers per second) to get the approximate time it takes.
Please note that light traveling through other mediums, such as air or transparent materials, can be slightly slower due to interactions with atoms and molecules in the medium. However, in a vacuum, where there are no particles to interact with, light travels at its maximum speed.