Hatching Eggs is done just like the main games in that you have to walk in order to hatch the egg. Each egg has got a set distance that needs to be traversed before the egg will hatch. Unfortunately, there is no way of speeding this up using a Pokémon. You need to have the app open while walking for the distance to count. If the app is closed, then the egg will not hatch.
In addition to this, if you end up travelling by a vehicle such as planes, trains and automobiles, the distance will not be counted. The game can detect how fast you move due to the GPS and will not register that distance for the Egg.
When the egg hatches, you'll get experience for hatching the egg being the distance travelled times 100 so 200, 500 or 1000 XP and, if it's a new Pokémon, you'll get 500 more XP. You will also receive a number of candies for the evolution line. This ranges from 5 to 40 candies randomly, based on the CP of the hatched Pokémon.