Minecraft wiki entry for Before_14w02a, associated text: Killing the Ender Dragon will give approximately 78 XP levels. The Ender Dragon actually drops 10 orbs worth 1,000 experience points, and another worth 2,000. Taken separately, the smaller orbs could take a player from zero to level 32, while the big orb would take a player from zero to level 41.
Maximum xp value can be gained by /xp command is 2147483647 (which is 2^31 - 1. Likely a limitation due to the 32 bit nature of Minecraft.)
Maximum level is 24791