It should be noted that moving one's first Command Center to a gold base is never worth it.
EDIT: There seems to be some debate about the efficacy of the
so-called "Gangnam" strategy of lifting your CC and moving to the
gold minerals, especially on Prion Terraces which now features a
defensible, natural gold base. It seems that builds designed for this
purpose can bring a player to an advantage, if they don't face any
Generally, you have to take into account two factors when deciding whether to take a gold base or a regular one.
First, is the map itself. As others have pointed out, they are usually in places that are difficult to get to or defend. In this case, you have to evaluate how likely you are to be attacked at that location before you are able to defend it, and whether the location is more of an asset or a liability.
There is a map in the current map pool, Prion Terraces, that features high-yield minerals at both the third and fourth expansions. Many players opt to grab the high yield as their first expansion, as it isn't that far away from the main base. It is a bit more difficult to defend, but not impossible, and holding the forward position gives a player a little more map control (as it is more difficult to contain players on the low ground) and makes taking the third base (the natural, now safely in your pocket) really easy.
The other thing to take into account is your strategy in the match. The fact is that you will be bringing in minerals noticeably faster, and noticeably faster than you are bringing in gas. Therefore, you are going to want an army composition that features more mineral-heavy units. If you risk something to take a gold base, and end up floating alot of minerals that you can't seem to use, then it was a wasted effort.
However, if taken at the right point in the game it can pay off handsomely. In last year's GSL, a lot of Zerg players were catching Terrans off guard by sneaking an early gold base on Vaani Research station, then quickly pumping out zerglings and roaches and overwhelming their opponent who could not keep up in production. At first, it looked unbeatable, but Terrans soon began to scout it and counter it and the strategy would sometimes fall flat.
A gold base can supercharge your strategy if taken at the right time and leveraged properly. However, bear in mind that it is often a risky move as it can divide both your army and attention at a critical point in the game.