The National Electrical Code (NEC) added swimming pools to their standards and regulations (article 680) in 1968. Pools built before then likely have sub-standard electrical components. The only known danger of electrocution stems from pools that were installed before 1965. If your pool is from that era, encapsulate lights with an epoxy putty made to be used underwater. Spread the putty around the light unit, sealing any gaps or cracks. Older pools should also be retrofitted with ground fault circuit interrupters. The devices will turn off power if there is an alteration in the current flow. If your pool is older and you're worried about electrical safety, you should consider bringing in an electrician to update it.
Pool lights are sealed inside a protective waterproof casing which prevents water from reaching the light bulb. Water surrounds the unit, keeping it from overheating. For this reason, the light should not be operated outside of water. A niche behind the light stores several feet of electrical cord. This cord can be unraveled if the fixture needs to be taken out for repair. Wiring conduit connects the pool light to the junction box, placed at least 3 feet away and 18 inches above water level. The junction box should be water and child proof.
If you choose to install lights in the pool wall, you should hire a professional. In fact, the code departments in most cities require that you hire a licensed electrician to do the electrical work in your pool. Each light should be connected to a separate extension cord leading to the breaker box. Even if your older lights are still working, examine them for signs of corrosion. If water has compromised the fixture, replace with new fixtures. They can run close to $200 and take one hour of labor to install.
Among the safest and easiest lights to install are floating lights. They are individual units with no cords or plugs. Many are powered by AA batteries. All you have to do is set the light in the water. Options include models that contain a rechargeable battery, which you manually turn off and on, or models with a light sensor that turns on once the sun starts to go down. Other floating lights on the market turn on as soon as they sense being placed in water.