Light is very important for fish; here are some excerpts from an article I wrote a while back that may explain this. Feel free to ask questions.
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.
Turning the Tank Light On/Off
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. Bright camera flashes can also be stressful in the same way. So also would any unnatural effect such as strobe lighting.
Thom Demas, curator of fishes at the Tennessee Aquarium, defines stress as anything that threatens to disrupt an organism’s normal physical, mental and/or emotional state. The organism must then expend energy dealing with the stressor, which leaves it with less energy to deal with other things, such as pathogens. “If the fish are busy running from or hiding from that weird phenomenon of ‘instant lights on or off,’ they may be wasting energy to this stressor and eventually get sick from something that is most likely ubiquitous and that they would have tolerated had the stressing event not been there,” says Demas. There is now ample scientific evidence that in fish as in humans, stress at any level has a very negative impact on the immune system because it disrupts the physiological equilibrium of the fish.
The solution with tank lights is obvious: the room should always be reasonably well lit when the tank light comes on and when it goes off. As Marc Kind, curator of fishes and invertebrates at the Adventure Aquarium in Camden, New Jersey, says, “this is just good, sound husbandry.” Given the evidence mentioned previously of the time it takes for fish to adjust, the room should be lit for at least an hour before and after the tank light is turned on or off respectively. From my own experience this all but eliminates any frantic reactions from the fish. They will uniformly and quickly swim toward the room light source (be it light coming in the window or from a lamp) when the tank light goes off, but without frantic crashes and jumping into the tank cover glass which will otherwise occur.
The Day/Night Cycle
Most animals have an internal body clock, called a circadian rhythm, which is modified by the light/dark cycle every 24 hours. This is the explanation for jet-lag in humans when time zones are crossed—our circadian rhythm is unbalanced and has to reset itself, which it does according to periods of light and dark. Our eyes play a primary role in this, but many of our body cells have some reaction to light levels. In fish this light sensitivity in their cells is very high.
Previously I mentioned that the rods and cones in the eye shift according to the changes in light. This process is also anticipated according to the time of day; the fish “expects” dawn and dusk, and the eyes will automatically begin to adjust accordingly. This is due to the circadian rhythm.
This is one reason why during each 24 hours a regular period of light/dark—ensuring there are several hours of complete darkness—is essential for the fish. In the tropics, day and night is equal for all 365 days a year, with approximately ten to twelve hours each of daylight and complete darkness, separated by fairly brief periods of dawn or dusk. The period of daylight produced by direct tank lighting can be shorter; and the period of total darkness can be somewhat shorter or longer—but there must be several hours of complete darkness in the aquarium. The dusk and dawn periods will appear to be stretched out, but that causes no problems for the fish. It is the bright overhead light that is the concern, along with having a suitable period of total darkness. And the "day" period when the tank lights are on should be one continuous period, not sporadic, and it should be the same every 24 hours or it will impact the circadian rhythm causing more stress.