This article has a quick guide to formation,
http://scienceweek.com/2003/sc031010-5.htm (13kb)
gold melts at low temps and gets carried to the surface in hydrothermal vents around the edges of granitic batholiths (as is quartz) and they solidify out into veins in the country rock as the pressure reduces, this is closer to the surface than diamonds hence more common. As erosion occurs gold, being heavy and non-reactive, gets left behind as alluvial deposits,