In an earlier post I talked about how certain kinds of dark matter might be detectable by the global positioning system (GPS). Part of the reason for that is due to the fact that GPS satellites have extremely precise clocks in them. So precise that the relativistic effects of gravity and relative motion have a measurable effect on the rate at which their clocks tick. This led some readers to ask just how gravity can affect the flow of time. It all has to due with Einstein’s theory of relativity.
One thing to keep in mind is that neither relative motion nor gravity “slow time down.” There is no cosmic clock, or absolute time frame in the universe, and whether you are moving quickly or in a strong gravitational field your experience of time will always be the same. That said, your local time can be slower relative to other time frames. With relative motion, the time dilation effect is due to the fact that light (in a vacuum) always has the same measured speed.
We can see how this works if we imagine a clock made with light. Take two mirrors and place one above the other and facing each other, then bounce a pulse of light between them. We can measure time by counting the number of times the light bounces off a mirror. Each bounce is like the tick or tock of a mechanical clock. If you could watch the pulse of light, you would see it move up and down between the mirrors at the speed of light. Up and down at a constant rate. Now suppose you took your clock on a fast moving train. Standing in the aisle of the train, you would see the light pulse move up and down at the same rate as before. Up and down at the speed of light. But as I watch you speed past, I see something slightly different. I would also see the pulse move at the speed of light, but from my view the light can’t move straight up and down because it must also be moving along with you. I would see the pulse move diagonally up then diagonally down, which is a slightly longer distance between each bounce. That means it would take the light longer to travel from bounce to bounce. So from my point of view the ticks and tocks of your clock are slower than the ticks and tocks as you see them. Your clock appears to be running slow because of your motion relative to me. The faster you move relative to me, the more your clock will slow down from my point of view.
The gravitational time dilation effect is due to the fact that gravity is a curvature of space and time. One consequence of this that the path of light is deflected by this curvature. Since the curvature is caused by the presence of mass, this means that the closer a beam of light is to the mass, or the larger the mass, the more strongly the light is deflected toward the mass. So suppose I sent you a flash of light every second from my point of view. Without any gravitational curvature, you would see a pulls of light once a second. But if I were to move toward a large mass such as a planet or star, then its mass would deflect my light signal. In this case the light you see would take a deflected path to reach you rather than the shorter straight path. The stronger gravity is at my location, the more the light is deflected, and the longer it would take to reach you. Thus, the slower my time appears to you.
Now you might argue that in both of these cases only light has been affected. Sure, time appears to slow down, but that doesn’t mean that our clocks really are ticking at different rates. From a theoretical standpoint, the appearance of time dilation must be the reality. There is no absolute frame against we can measure anything, so our relative appearance is the only thing we have. Experimentally we have validated both effects. One consequence of gravitational time dilation is gravitational redshift, which was first observed in 1959. Then there is the observed difference in atomic clocks at different altitudes, and of course the GPS experiment we do every day.