From where does gravity get its energy to do work upon an object? For an object or force to do work, it needs energy. But, from where does the gravitational force get the energy to do work upon, say, a falling object? The gravitational force is doing work upon the object, isn't it?
I searched the internet and Physics SE, and found this. Caesar asked a similar question and udiboy1209 answered it.
udiboy1209 says:

Let's take the example of a ball dropped from some height. Gravity of the earth pulls it downward, doing work on the ball and giving it kinetic energy. The question you ask is where did it get this energy from?
  Go back a step and think about how this ball ended up at such a height? You lifted it up with your arms and put it on that height. Your arms did work against gravity, spent some energy to put that ball on that height. Where did that spent energy go? This was given to gravity!
When you do work against gravity, you store energy in the gravitational field as gravitational potential energy, which then gravity uses to do work on that object.

But isn't the work done by our arms stored on the ball? He says that the energy spent is stored in the gravitational field. Work is done upon the ball; shouldn't the energy be stored on the ball? If so, then where does gravitational force get its energy to do work upon the ball on the first place?
 A: Ball, Field or Force


When you do work against gravity, you store energy in the gravitational field as gravitational potential energy, which then gravity uses to do work on that object.

But isn't the work done by our arms stored on the ball?
He says that the energy spent is stored in the gravitational field.
Work is done upon the ball; shouldn't the energy be stored on the ball?

(my emphasis)
No - it doesn't follow that energy should be stored in or on the ball.
Forget gravity for a moment. Imagine you are floating far away in space and have two large objects next to each other connected by a spring. If you put your feet on one object and use your arms to move the other object away, you feel as if you are doing work on the object but the energy is stored in the spring.
Origin of energy

where does gravitational force get it's energy to do work upon the ball

As Virgo and Cort Ammon's answers explain, when you move the ball away from the Earth you are storing energy in the gravitational field, it is a function of the configuration of objects within that field.
Storage mechanism
or - what the heck is this gravity thing anyway?

*

*How exactly does gravity work?

*Why would spacetime curvature cause gravity?

*If gravity isn't a force, then why do we learn in school that it is?
As Feynmann once explained, sometimes you can't satisfactorily explain phenomenon other than through mathematics.
A: You can think of gravitational energy being stored in a system of bodies, not just one body or the other.  When you apply force over a distance (work) to the ball, it is being stored in the system of "the ball and the Earth."  We can capture the concept of this energy stored in the system by saying its "stored in the gravitational field," but at the very minimum we should say that it's stored in the system.
Similar issues show up in electrostatics.  In electrostatics, potential energy is almost always between two bodies, not in one or the other.  If you choose to think of it as being in one body or the other, you end up in some really peculiar paradoxes.
What makes this tricky to understand intuitively is that we have many cases where one object is so astonishingly massive compared to the other that we can often handwave away this system-wide thinking, and pretend that the ball is the thing that actually has the gravitational potential energy.  This is similar to how electrical engineers assume there is such a thing as a "ground" and that it can sink infinite electrical energy (there's a glorious pile of issues like ground loops which are associated with faulty assumptions regarding grounds).  However, in many reasonable environments, these simplifications (such as assuming the earth doesn't move in response to us jumping upwards) are effective, so we keep using them.
There are also theories regarding what gravity "is" in general relativity and quantum mechanics.  If one wishes, one can pursue those and come to a deeper answer.  However, I don't believe they are necessary for everyone to learn.
A: In Newtonian gravity, the potential energy of the ball does not get "stored" anywhere. It is just a function of the configuration of the ball and the earth system.
In general relativity, the concept of gravitational energy is not always well defined. But it is meaningful in the Newtonian limit which requires a weak gravitational field and velocities much less than light. In that case, the mass of the system needs to take into account the Newtonian binding energy.
Another case energy is well defined in is if you have an isolated system in asymptotically flat spacetime, such as two orbiting neutron stars. Then one can evaluate how much energy is carried away by the gravitational waves. This causes the neutron stars to inspiral and has been measured very precisely.
A: Space acts as reservoir of energy. 
For simplicity, consider space as invisible spring connecting "each mass/energy unit of one body" to  "each mass/energy unit of another body". The spring is one way, it only shrinks and it does so per inverse square law. You can never press it enough to make it a pushing spring.
That invisible spring can be considered as the energy pool (potential).
A: Let's split Earth in 2 equal objects of mass
m1 = m2 = Mearth/2 
Let's take a look at the potential energy between each of the 2 objects and a 3rd object of mass mobject.
E1 = G m1 mobject / r1,object
E2 = G m2 mobject / r2,object
so if m1 and m2 are very close together r1,object = r2,object = r so the total potential energy is
Etotal = E1 + E2 
= G m1 mobject / r1,object + G m2 mobject / r2,object 
= G (m1+m2)mobject / r 
= G Mearth mobject /r
The potential energy is actually obtained from integrating
over ρdV and summing all contributions from all other objects: 
E = Σi ( G mobject ρidV /ri,object )
The more the mass the more the Potential Energy, the closer the harder to escape from it.
So, if you would want to move Earth from Sun's orbit to another solar system you would need to give enough energy to Earth to escape from its orbit around the sun.
If you were to quantize this energy that you need to give to Earth as E = mc2 you will find it on the order of mass of our Moon.
G = 6.674×10−11 N(m/kg)2
Mearth = 5.9737 x 1024 kg
Msun = 1.989 x 1030 kg
rearth, sun = 149597890 103 m 
Eearth, sun = G mearth m sun / rearth, sun 
so Eearth,sun = 5.2387488887711 1033 Jules 
and if we convert to mass (E=mc2) the equivalent mass is 
mE = 5.8208320986346 1016 kg
So to move Earth form our solar system to another solar system we need energy to break this potential energy + some energy to "make" it arrive at its new destination... etc. The rest you can deduce by yourself.
As per total some 5.82 1016 kg from Earth (and Sun) are from our potential energy.
Gravity gets its energy from mass

Now if one wants to move to a deeper interpretation, like in the view of General Relativity, mass or energy curves space which means that gravity is but curved space around a mass, like denoted by Schwarzschild spherically symmetric metric 
dτ2 = (1 - 2GM/r)*dt2 - (1/c2)(dr2/(1 - 2GM/r) + r2(dθ2 + sin2θdφ2))
A: I am not going to try to tell any truths about where a falling ball is getting energy. Instead I just say something that maybe makes some sense:
An arm lifting a ball gives energy to the ball. Yes that is a reasonable idea.
Then the energy either stays in the ball, or it moves from the ball to somewhere else. 
As we have learned about such idea that the energy spent lifting a ball is stored in the gravity field, we can make a guess that the energy moves from the ball to the gravity field, if the energy moves from the ball to somewhere else. 
