It is important to have ambient room light when the tank light goes out. The sudden change of light/dark is extremely stressful to fish. My tank lights come on after daylight is in the room, but when they go off in winter I have a room light that is also on a timer to come on just before the tank lights go off and this remains on for an hour.
I did an article on the effects of light on fish a couple years back, and will excerpt the relevant bits that explain why:
When the tank light suddenly turns on in a dark room, fish will dive to the substrate, dash about frantically often hitting the glass sides of the aquarium, or even jump out of the water. The same reactions occur when the tank lights are suddenly turned out. Aside from any possible physical injury the fish may sustain, these sudden changes in the light cause significant stress to the fish.
The health of fish is closely connected to the intensity of the overhead light, various types of light, and sudden changes from dark to light or light to dark. To understand this, we must know something about the fish’s physiology. The primary receptor of light is the eye, but other body cells are also sensitive to light.
Fish eyes are not much different from those of other vertebrates including humans. Our eyes share a cornea, an iris, a lens, a pupil, and a retina. The latter contains rods which allow us to see in dim light and cones which perceive colours; while mammals (like us) have two types of cones, fish have three—one for each of the colours red, green and blue. These connect to nerve cells which transmit images to the brain, and the optic lobe is the largest part of the fish’s brain.
These cells are very delicate; humans have pupils that expand or contract to alter the amount of light entering the eye and eyelids, both of which help to prevent damage occurring due to bright light. Fish (with very few exceptions such as some shark species) do not have eyelids, and in most species their pupils are fixed and cannot alter. In bright light, the rods retract into the retina and the cones approach the surface; in dim light the opposite occurs. But unlike our pupils that change very quickly, this process in fish takes time. Scientific studies on salmon have shown that it takes half an hour for the eye to adjust to bright light, and an hour to adjust to dim light. This is why the aquarist should wait at least 30 minutes after the tank lights come on before feeding or performing a water change or other tank maintenance; this allows the fish to adjust to the light difference.