Wolfram Alpha:

```Gravitational Time Dilation
---------------------------
Clocks which are far from massive bodies (or at higher gravitational
potentials) run faster, and clocks close to massive bodies (or at lower
gravitational potentials) run slower. This is because gravitational time
dilation is manifested in accelerated frames of reference or, by virtue
of the equivalence principle, in the gravitational field of massive
objects.

The equivalence principle that states that all accelerated reference
frames are physically equivalent to a gravitational field of the same
strength. For example, a person standing on the surface of the Earth
experiences exactly the same effect as a person standing in a space
ship accelerating at 9.8 m/sec2 (that is, generating a force of 9.8
N/kg, equal to the gravitational field strength of Earth at its surface).
According to general relativity, inertial mass and gravitational mass
are the same.

A common equation used to determine gravitational time dilation is
derived from the Schwarzschild metric, which describes spacetime
in the vicinity of a non-rotating massive spherically-symmetric object.
The equation is:

T = T0/√(1 - 2GM/Rc2)

Similarly the length contraction radial to the mass givem by:

L = L0/√(1 - 2GM/Rc2)

where

T is the time interval measured by a clock far away from the mass.
L is the length  interval measured far away from the mass.
L0 is the proper length (length in the vicinity of the mass).
T0 is the proper time (time in the vicinity of the mass).
G is the gravitational constant
M is the mass of object creating the gravitational field
R is the radial coordinate of the observer
c is the speed of light

Note 2GM/c2 is the Schwarzchild radius of M```