Chlorine itself is a gas at room temperature. Ordinary table salt (sodium chloride, NaCl) is half chlorine, and a simple electrochemical reaction with salt water produces chlorine gas easily. That same reaction produces sodium hydroxide (NaOH), and by mixing chlorine gas with sodium hydroxide you create sodium hypochlorite (NaOCl). When you buy a gallon of bleach at the grocery store, what you are buying is the chemical sodium hypochlorite mixed with water in a 5.25-percent solution. You're buying salt water that has been changed slightly by electricity.  

Chlorine is chlorine, so the chlorine in bleach is the same as the chlorine in drinking water and in a swimming pool.  In fact, you can use chlorine bleach to treat a swimming pool or to treat drinking water.  A gallon of bleach provides 1 part per million (PPM) of chlorine to 60,000 gallons (about 250,000 liters) of water. Typically, a pool is treated at a rate of 3 PPM, and drinking water is treated at anywhere from 0.2 PPM to 3 PPM depending on the level of contamination and the contact time.  

Chlorine is used in pools and drinking water because it is a great disinfectant. It is able to kill bacteria and algae, among other things.  Chlorine also makes a great stain remover, but not because of the chlorine itself.  Natural stains (as well as dyes) produced by everything from mildew to grass come from chemical compounds called chromophores.  Chromophores can absorb light at specific wavelengths and therefore cause colors.  When chlorine reacts with water, it produces hydrochloric acid and atomic oxygen. The oxygen reacts easily with the chromophores to eliminate the portion of its structure that causes the color. 

It's a whole lot safer to drink chlorinated water than water contaminated with disease-causing bacteria. Millions of people have died from water-borne diseases, and these diseases are largely eliminated in modern water systems through the use of chlorine.  If you are worried about the chlorine in your water, all you have to do is let the water stand for a day or two in a loosely covered container in your refrigerator and the chlorine is eliminated.