Where do magnets get the energy to repel? If I separate two magnets whose opposite poles are facing, I am adding energy. If I let go of the magnets, then presumably the energy that I added is used to move the magnets together again.
However, if I start with two separated magnets (with like poles facing), as I move them together, they repel each other. They must be using energy to counteract the force that I'm applying. 
Where does this energy come from? 
 A: As is said in a comment, the reasoning in the first paragraph is correct but the one in the second paragraph is wrong.
If you apply a force on something without "moving" the work is null and there is no energy exchange involved (this is not the same thing than doing that with your muscles, but that's another story :p). ( Work =  integral[a to b] of F dot dx ; so Work = 0 if there is not "circulation").
Thus the magnets do not need any energy to statically counteract the force.
However, if you do move the magnets, then you need to give some energy. This energy is stored in the system because you cause a variation of magnetic flux: magnet 1 moving induce a variation of flux seen by magnet 2, and this will change the state of magnet 2, increasing its potential energy.
A: As others have pointed out, the question is somewhat misworded.
The correct question is probably just "Why do magnets repel?", which can be traced back to the question of why electromagnetism (EM) is a fundamental force of nature. Like gravity, it's one of the four known fundamental forces of nature.
Regarding the use of the word "energy". Energy is the same thing as work. Work = Force x distance. If there is a 10N [Newton] force acting on a ball, and you move the ball by 1m [meter], you have done 10N x 1M = 10Nn = 10J [Joule] of work (provided the force is constant). So, if you move the magnetic poles against each other, you do work (against the EM field). Then, if you attach the magnets to a spring and let go, the springs will compress. The 10J of work you invested is now stored in the springs! Then, if you remove the magnets and put a bullet on the spring, and let go, you can use the 10J of energy to launch the bullet (work is converted to kinetic energy), and so on =)
What happens when you push two magnets against each other, but then just hold them in place? Per the above definition of Work = Force x distance, you're not doing work, because distance = 0. But clearly your muscles are straining, and you're burning calories (which is just another unit of energy or work, like Joules), so what's going on? From a physics textbook point of view, no work is being done. This is similar to placing an apple on a table. The table is countering the force of gravity, like your muscles in the magnet example. The table has no muscles, because it is made of wood, and it won't collapse under the weight of the apple. In reality, the stiffness of the table/wood is provided by the electromagentic interactions of the atoms making up the table, so in the end it is the EM force counteracting the gravitational force. In the original magnet/muscle example, your arms are not made up of wood, so your body is doing biochemical/mechanical work to stiffen the cells in your arms by burning the food you ate. (The fact that this process is not perfect means that heat is a by product of this process, that's why your muscles get hot and you start sweating.)
A: Magnetic field in this case (a set of magnets in space, no relativity involved) is conservative, which means it has a potential -- each positional configuration of charges (or dipoles in this case) has its fixed energy which does not depend on history or momenta of charges. So, the work you put or get from displacing them is just exchanged with the potential energy of the field, which means no energy is created or destroyed, just stored.
A: I'll make some guesses about the motivation for the question. I think you're looking for a simple answer. You're choosing magnets because you feel that you understand how electric charges work.
In this case, if you bring two positive charges close to one another you will also feel a repulsion. The source of the energy for this repulsion is a place similar to, but a little less complicated than, the source of the energy for the repulsion of two magnets.
A: You are right about how in the first scenario the energy you put into the magnets results in kinetic energy, but the second scenario is incorrect. Saying that the magnets are using energy to repel each other is like saying that the chair I'm sitting in is using energy to keep me from sinking into the ground. I hope this clarifies your understanding.
A: Magnetic fields is created by the low atomic magnets inside the piece of metal, piece of iron aligning together in a line. The actual magnetism in a piece of iron or in a permanent magnet is actually caused essentially by electrons orbiting in one direction more than the other, and the electrons are going to keep on orbiting forever until something interrupts it.
Moreover, the work you put or get from displacing 2 magnets is just exchanged with the potential energy of the field, which means no energy is created or destroyed, just stored.
