I'd like to mention that the law of conservation of energy applies *only* to what are termed "closed" systems (or "isolated" systems, depending on the book you read).
This means:
1. A system that, practically speaking, is the only thing in the universe: when, for example, you solve a problem like "a ball is rolling up a hill at such-and-such a speed", then only the ball and hill "exist" and nothing else does.
2. Or, a system that is perfectly closed off from everything around it: nothing can enter or leave, not even heat.
Just to give an example, then:
1. the energy of the ball in your example isn't conserved, because it's not a closed system. There's no problem with this, because of the point above.
2. If you add in the ground and the air, then you *do* get back to a closed system, and the total energy is again conserved: all the energy the ball loses can be found again in the air/ground, eg as heat.