There are two issues here. Providing a good ground for your electrical service *and* grounding metal pipes in the house to prevent them from becoming energized.
Grounding your electrical service...
In the old days when all pipes were metal, a cold water pipe ground would do. But then there were problems with rubber grommets on water meters in basements isolating the inside water piping from the outside water piping, plastic piping run outside underground, and the ground wires becoming disconnected or damaged say by a lawnmower or whatever.
So a better grounding solution was found. That is a cold water pipe ground
*and* a separate ground wire run from the electrical service panel to two ground rods placed 6 ft. apart. (double back-up) Also a ground wire which electrically connects the water pipe before the water meter to the water pipe after the water meter.
Grounding metal pipes/objects in the house to prevent them from becoming energized...
The idea of a 3rd prong on an electrical plug (ground wire) for an electrical appliance is that the metal case of the appliance is grounded. Then should there be a loose wire which touches the metal case and a person walks up and touches the metal case, the person will not be electrocuted. Or it would trip the breaker also protecting someone from being electrocuted.
Same thing with metal pipes or objects in a house. It is possible that a hot water pipe (which might be isolated because of rubber grommets) could become energized. So it is a good idea to run a ground wire from the cold water pipe to the hot water pipe (in homes with metal piping).
Hot and cold water pipes are very accessible to people. Sinks, washing machine, etc. Although gas pipes are not readily accessible to people, I suppose it wouldn't hurt anything to ground this as well. If grounding the gas pipe, I think running a ground wire from the gas pipe (house side of meter) to the ground rods or to a cold water pipe ground would be best. I don't think it would be a good idea to run a separate ground wire from the electric panel to a gas pipe.
Also while grounding things in the house, it is very important to ground metal objects around sinks and especially the bathroom. Like metal medicine cabinets which have a built in light fixture. The heat from light bulbs can cause insulation on wiring to melt away, then the metal cabinet can become energized. In a bathroom you are in bare feet and might be turning on the water while opening the medicine cabinet with the other hand - zap!
What can go wrong...
I have seen ground wires from main electrical service panels become disconnected. There could be a situation where the ground wire(s) from the main service panel become disconnected but someone ran a ground wire from there to something else like a gas pipe. Then an appliance could malfunction and this in turn could cause the gas pipe to become energized (if it was not inadvertently grounded via an appliance). So for this reason it is *not* a good idea to ground things such as this to a connection in the electrical panel, but to ground them directly to a ground such as cold water pipe and/or the ground rods.
Also you can get different "ground potentials". The ground at point A may be slightly different electrically from the ground at point B. For this reason, it is a good idea to ground everything at one point. That is run all ground wires or bond various grounds to say the ground rods or a main grounding point.