A lucky egg is used to double the XP received for 30 minutes. They are best used when evolving your Pokémon and while using an incense. You can evolve about 70 Pokémon per lucky egg if you save that many over time. You can do this to power level your character.
You can purchase lucky eggs in the shop and receive them as rewards for leveling up as well. The prices to purchase are 80 pokecoins for 1, 500 pokecoins for 8, and 1250 pokecoins for 25. You will automatically receive 1 at levels 9, 10, 15, and 2 at level 20.