The previous poster is correct. First, one must make the assumption that all of the water lines in question are metal--normally copper or galvanized steel. (If not, none of the water lines can be used as an electrical ground.) Typically in this case, all of the cold water lines are connected through various fittings to each other, and to the water main which is normally buried underground to its connection to the water meter. The hot water lines, however, are connected together internal the the building structure but then pass through a hot water heater. This heater has insulating couplings or unions ('dielectric couplings') as part of its construction, in order to help prevent corrosion. These couplings break the electrical connection to the main, and so do not allow the hot water piping to connect electrically to Earth ground.
Often, the main building ground--or 'bond' wire--is routed from the main electrical panel to a clamp around the supply water line as it enters the building to take advantage of this physical contact with the ground and use it as an electrical 'ground' as well.
Hope that helps...