Lighting is really for our benefit so we can see the fish. Light does bring out the colour in a fish more though & a fishes colour will fade when the lights are off. It is necessary if you have live plants in a tank.
Most fish prefer subdued light as bright light hurts their eyes (they have very good eyesight) & if there is enough natural light coming from windows etc. you don't need to have the tank light on BUT bright or too much natural sunlight can cause the growth of algae.
If using a tank light, it is a good idea to have them on a timer (but not a necessity) it just makes it easier for us & also maintains a regular routine. Normally tank lights should only be on no more than 6-8 hrs a dy or 10-12 hrs for live plants, but the longer the light is on the more likely it is that you may get algae, if it is strong light.
Dano is right & there are other posts that have good info. on the subject.