The value of Stardust cannot be overstated. Though there are multiple ways to earn it you cannot buy it and it’s easy to burn through when powering up a Pokémon. As a Pokémon’s CP level raises the amount of Stardust and Candy it needs to Power Up increases.
So however you come across it just make sure you horde Stardust and only use it on a Pokémon that you plan on powering up for gym battles.
How to get Stardust
There’s three ways to get Stardust – capturing Pokémon, controlling Gyms or hatching Eggs. Every Pokémon you successfully capture earns you 100 Stardust (as well as three Candy for it’s species). Once you take over a Gym you can claim the Defender Bonus of 500 Stardust (and 10 Pokécoins) in the Shop straight away and then every 21 hours thereafter.
Eggs are the best source of Stardust, but the amount they give you varies depending on a number of factors, including the distance required to hatch the eggs. Here is a rough guide to how much Stardust you should expect from each Egg:
|2km||400 to 800||5 to 10|
|5km||800 to 1600||10 to 21|
|10km||2000 to 3000||17 to 30|