I read that the kanji 金 ("gold") can be pronounced both as kon and as kin.
When should it be pronounced kon and when kin?
Is there any rule about picking one or the other?
The readings "kin" and "kon" are on-yomi pronunciations for 金. The "kon" reading is the older one (go-on 呉音) and "kin" is newer (kan-on 漢音). They ultimately stem from Middle Chinese /ki̯əm/; notice that 今 has the same on-yomi pronunciations.
As a general pattern, go-on pronunciations are somewhat less common (relative to kan-on) in everyday words and more usually found in words related to Buddhism. (But that is not to say Buddhist words only use go-on either.) In the case of 金, the kan-on pronunciation is more common (among the two on-yomi pronunciations) by far. You will simply have to memorise the exceptions.
The character 金 can refer the idea of gold, metal in general, or money. Most commonly, it is read as かね (kane, kun-yomi) and キン (kin, on-yomi) when occuring in compounds.
There is also the コン (kon, on-yomi) reading which you mention. As Zhen Lin has pointed out, this is an older reading that is due to interaction between Japanese and Middle Chinese. Compounds that use this reading are e.g.
However, the other two readings are far more common.
In general, for the purpose of learning Kanji, I'd suggest studying the more frequent readings first (かね and キン in this case) and memorizing other ones on demand when encountering a word containing them.