It's called gravitational time dilation. It has to do with 3 basic things: relativistic time dilation explained in special relativity, gravitational potential, and the equivalence principal explained in general relativity.
To keep this brief, I'll gloss over relativistic time dilation. It's a result of velocity, however. For two reference frames going at different velocities, time will appear to slow down for the other. This is due only to the speed of light being an absolute reference frame.
Gravitational potential is the energy represented by objects of different heights in a gravitational field. An object one meter higher than another will have the potential energy associated with how fast it would go if it fell one meter, from the reference frame of the other. So it translates to velocity, tying in with the above paragraph. Maybe you can see where this is going.
The equivalence principal states that gravity is the same as acceleration in every respect (except for some minor ones which can be dismissed in a local framework). An accelerating object carries a velocity difference between to points in its acceleration. This velocity difference represents two reference frames in which relativistic time dilation applies. The same must also be true in a gravitational field, therefore. Two objects of different heights represent two points in an accelerated reference frame. Time dilation between them is the same as the velocity of an object falling from the higher one to the lower one.
All this is the brain child of Einstein, of course.