Dragon Eggs are placeable entities that turn into baby dragons; they are a drop from stage 4-5 female dragons, used to hatch tamed baby dragons.
To obtain a dragon egg, one must seek out a female 4+ dragon, which can be found sleeping in treasure-filled caverns deep underground. Once you've found one, kill it and right-click the body with an empty hand to collect loot, and it will drop a dragon egg of random color depending on the species. As of the 1.8.0 update, there is a way to differentiate between an untamed male and a female dragon. Male dragons have patched wings and straight horns, while females have curved horns and plain wings.
Dragon Eggs will hatch into baby (stage 1) dragons that are tamed as soon as they hatch (as long as the player is near the egg), but cannot be ridden, but you can put it on your shoulder.
The player can level up a dragon using the Dragon Meal. Once a dragon reaches stage 3 (can be checked by interacting with the dragon while sneaking), it becomes able to be ridden by a player.
Fire dragon eggs (Red, Gray, Emerald & Bronze) must be placed within a fire to start the hatching process. Once the egg starts moving, it will take a few minutes to hatch.
Ice dragon eggs (Blue, Sapphire, White & Silver) must be placed in water that could be surrounded by ice. If the water around the egg freezes, then it will hatch in a few minutes. (In some versions just putting in water works)
Lightning dragon eggs (Copper, Electric Blue, Amethyst & Black) must be exposed to rain to start the hatching process. Once the egg starts moving, it will take a few minutes to hatch. (If the rain stops the process of hatching will stop as well.). When the Lightning Dragon egg hatches there will be a strike of lighting. Have a bucket ready, you may have to put out the fire before it spreads.