Time dilation is not solely caused by an object's mass but is a consequence of relative motion and gravitational fields. Both velocity and gravitational fields can induce time dilation.
Special Relativity, which deals with the effects of relative motion, predicts time dilation for objects moving at high velocities relative to each other. As an object moves faster relative to an observer, time appears to pass more slowly for the moving object relative to the observer. This effect is known as time dilation and is independent of the object's mass. It is a fundamental aspect of the theory of relativity and has been experimentally confirmed.
In general relativity, which includes the effects of gravity, time dilation also occurs due to gravitational fields. The presence of a massive object, such as a planet or a star, curves the surrounding spacetime. As a result, time flows differently in regions with different gravitational potentials. In stronger gravitational fields, time appears to pass more slowly relative to regions with weaker gravitational fields. This phenomenon is observed in various scenarios, such as near black holes or within strong gravitational fields like those around massive celestial bodies.
The connection between mass and time dilation is more complex. While it is true that objects with mass exhibit time dilation as they approach the speed of light (due to their increasing relativistic mass), it is not accurate to say that faster objects gain mass. The concept of relativistic mass has fallen out of favor in modern physics, and the more precise formulation of relativistic effects uses the concept of energy and momentum instead.
To summarize, time dilation can occur due to both relative motion and gravitational fields. It is not solely caused by an object's mass but is influenced by factors such as velocity and the strength of the gravitational field.