Its Time_dilation(time slowing), not time travel. Time Dilation is a difference in the elapsed time measured by two clocks, either due to them having a velocity relative to each other, or by there being a gravitational potential difference between their locations. After compensating for varying signal delays due to the changing distance between an observer and a moving clock (i.e. Doppler effect), the observer will measure the moving clock as ticking slower than a clock that is at rest in the observer's own reference frame. A clock that is close to a massive body (and which therefore is at lower gravitational potential) will record less elapsed time than a clock situated further from the said massive body (and which is at a higher gravitational potential). In the context of special relativity it was shown by Albert Einstein (1905) that this effect concerns the nature of time itself, and he was also the first to point out its reciprocity or symmetry
Now, similar time dilation can also be seen in some of the stories of Hindu Puranas.
Time Dilation example 1: King Muchukunda
Muchukunda, son of King Mandhata, and brother of equally illustrious
Ambarisha was born in the Suryavanshi solar dynasty.
Once, in a battle, the Devas were defeated by the asuras. Tormented by
arrows, they sought help from king Muchukunda. King Muchukunda agreed
to help them and fought against the asuras for a long time. Since the
Devas did not have an able commander, king Muchukunda protected them
against the onslaught by asuras, until the Devas got an able commander
like Kartikeya, the son of Lord Shiva. Then Indra said to the king
Muchukunda, "O king, we, the Devas are indebted to you for the help
and protection which you have given us, by sacrificing your own family
life. Here in the heaven, one second equals one year of the earth and
you had fought with asuras for one year of heaven . Since, it has been
a long time, there is no sign of your kingdom and family because it
has been destroyed with the passage of time.
Time Dilation example 2: Princess Revati
Revati, within Hinduism, is daughter of King Kakudmi and consort of
the God Balarama, the elder brother of Krishna. Bhagavata Purana,
Vishnu Purana and Garga Samhita narrate the tale of Revati.
Revati was the only daughter of King Kakudmi(sometimes called
Kakudmin, Revata or Raivata), a powerful monarch who ruled Kusasthali.
Feeling that no human could prove to be good enough to marry his
lovely and talented daughter, Kakudmi took Revati with him to
Brahmaloka(abode of Brahma) to ask the God's advice about finding a
suitable husband for Revati.
When they arrived, Brahma was listening to a musical performance by
the Gandharvas, so they waited patiently until the performance was
finished. Then, Kakudmi bowed humbly, made his request and presented
his shortlist of candidates. Brahma laughed loudly and explained that
time runs differently on different planes of existence and that during
the short time they had waited in Brahmaloka to see him, 27
chatur-yugas(a chatur-yuga is a cycle of four yugas, hence 27
chatur-yugas total 108 yugas, the Garga Samhita differs and says 27
yugas in total) had passed on Earth and all the candidates had died
long ago. Brahma added that Kakudmi was now alone as his friends,
ministers, servants, wives, kinsmen, armies and treasures had now
vanished from Earth and he should soon bestow his daughter to a
husband as Kali yuga was near.
King Kakudmi was overcome with astonishment and alarm at this news.
However, Brahma comforted him and added that God Vishnu, the
Preserver, was currently on Earth in the forms of Krishna and Balarama
and he recommended Balarama as a worthy husband for Revati.
Kakudmi and Revati then returned to earth, which they regarded as
having left only just a short while ago. They were shocked by the
changes that had taken place. Not only had the landscape and
environment changed, but over the intervening 27 chatur-yugas, in the
cycles of human spiritual and cultural evolution, mankind was at a
lower level of development than in their own time. The Bhagavata
Purana describes that they found the race of men had become "dwindled
in stature, reduced in vigour, and enfeebled in intellect."
Time Dilation example 3: Srimad Bhagvatam: Canto 10
13.40 The selfborn one [Brahmâ] returning after such a long time, saw that, even though it was but a moment later to his own notion, one
year later the Lord was playing together with His expansions like He
Hindu scriptures describe 14 Lokas where Brahma Loka is the highest loka and Patala is the lowest 14th loka, while earth is on 7th Bhu loka and Swaraga(where Indra rules) is on 5th loka. Now, King Muchukunda was fighting for a year in Indraloka on 5th realm, while Revati was in 1st realm of Brahmloka for few seconds, hence time dilates(slows) from Brahmloka(1st realm) to Indraloka(5th realm) to Bhuloka(Earth).
As per modern science, time dilates as one moves from black holes to massive stars to average stars(like our sun) as gravity and bend of space-time curvature of each star and its solar system is different leading to the time dilation. This can be better understood through Einstein's Space-Time continuum.