Experience is divided by the amount of heroes close to the unit when it dies, this is why when people solo lanes, they gain twice the experience that the other heroes do. As you level up, it requires more and more experience to level up.

Currently, (V6.0+) the level cap is 18 and this requires 17,000 experience to reach.