Visible light consists of electromagnetic waves, which can travel indefinitely in a vacuum without losing energy. In a perfect vacuum, there are no particles or other material to interact with the light and cause its energy to dissipate. Therefore, visible light can theoretically travel an infinite distance without losing energy.
However, it's worth noting that in reality, there is no such thing as a perfect vacuum. Even in the vast expanse of space, there are extremely sparse particles, such as hydrogen atoms, which can scatter and absorb light to some extent. Over extremely long distances, this can cause the light to gradually lose energy. However, these losses are extremely minimal and would not significantly affect the propagation of light over short to medium distances.
At room temperature, light does not lose energy due to its temperature. Light energy is independent of the temperature of its surroundings, and it can travel through a vacuum indefinitely without being affected by room temperature.
Therefore, visible light can travel long distances in a vacuum without losing energy, and it would take an effectively infinite amount of time for the energy of light to dissipate in this scenario.