Those are experience orbs!:
An Experience Orb is an entity similar to an item entity, an orb that fades between a green and yellow color.
Experience orbs drop in the following situations:
- When a killed mob's corpse vanishes
- When a player is killed
- When animals breed
- When mining any ore that drops its mineral (that is, not iron, gold, or any use of Silk Touch).
- When you break a Bottle o' Enchanting.
- Mining (destroying) a spawner block
- Breeding animals.
You also gain experience (but no experience orbs will drop) from:
- Smelting any of various items.
- Trading with villagers.
When you collect experience orbs your are rewarded with experience points.
According to the "Experience Orb" page on the wiki, you collected 12,000 experience points from killing the Ender Dragon:
The Ender Dragon drops 11 huge orbs totalling 12,000 experience points.
When you collect enough experience points you will level up. You can use your levels for Enchanting, or to use an Anvil.