According to special relativity, time dilation occurs as an object's velocity approaches the speed of light. As an object with mass approaches the speed of light, time appears to slow down from the perspective of an observer at rest relative to that object. However, for a massless particle such as a photon, which always travels at the speed of light in a vacuum, the concept of time dilation is not applicable in the same way.
From the reference frame of a photon, time does not appear to pass at all. This is because, according to the theory of special relativity, as an object with mass approaches the speed of light, its relativistic mass becomes infinite, and the passage of time for that object would take an infinite amount of time as observed by an outside observer.
However, it's important to note that this perspective is based on the theoretical frame of reference of the photon itself. Since photons travel at the speed of light, they do not experience time in the same way that we do. This does not mean that time stops for photons in an absolute sense, but rather that the passage of time is not experienced from their perspective.
For an outside observer, time still passes normally while observing the motion of photons. From their perspective, photons have a finite travel time from one point to another, and the observer will measure a specific time interval associated with that journey. So, while time does not pass for photons themselves, it continues to progress for the observers who perceive their motion.