Recently finished physicist Kip Thorne's The Science of Interstellar about his work to make the movie as scientifically grounded as possible. While written for the interested layperson, some of it was hard to follow. But it provided a lot of food for ruminating about the deep connections between gravity, mass, time and the speed of light.
At the speed of light, time stops. Anything with mass that reached the speed of light also achieves infinite mass. (This is one good reason to believe that nothing with mass can go that fast. Anything of infinite mass would need a great deal of thrust to keep going, indeed, an infinite amount.) Photons have no mass and thus they gain no mass. Anything – some ghost without a machine – traveling with that photon at 186,000 MPS would also be timeless and thus everywhere that photon will ever be all at once.
Time also stops with an infinite mass that is not going anywhere, at a black hole. Gravity slows time. At the event horizon of a black hole, spacetime is so warped that nothing can escape upwards – not time, not space, not matter, not light – but falls down into the black hole until it reaches the singularity at the “bottom.” While the black hole may have a certain mass – the mass left over from the collapse of the star that formed it – the singularity itself has the equivalent of infinite mass. Anyone watching a friend drop into a black hole would never see him or her actually fall all the way past the event horizon. From the outside, the friend would be seen moving ever slower. At some point, a second to the falling friend might be, for example, a billion years to the outside observer.
Not just black holes slow time. Anything with mass does, including earth. Einstein's theory of relativity predicts this. And indeed, time on the GPS satellites (orbiting over 16 thousand miles up) run some 45,900 nano seconds slower per day than clocks on earth. The stronger the gravity, the slower time goes compared to places of less gravity.
Mass warps spacetime and achieves that effect through gravity. We don't understand where gravity comes from and it does not fit into the Standard Theory of quantum physics. Relativity seems to describe the effects of gravity but neither meshes with the Standard Theory nor explains from whence gravity comes. String theory has been the Standard Model's framework to incorporate relativity as quantum gravity. To do so, it would require extra dimensions beyond the four we observe (three space and time). But recent experiments have found no supporting evidence for the simplest forms of such theories.