You earn them by winning achievements. On top of that, each time you level up and gain XP, you receive one gold coin.