Photons are massless particles, and according to the theory of special relativity, they always travel at the speed of light (in a vacuum), denoted by "c," which is approximately 299,792,458 meters per second. Photons do not accelerate in the traditional sense like massive particles, since they are always moving at their maximum speed.
When light passes through a medium like diamond, it interacts with the atoms in the material, causing a delay in its propagation. This delay is due to the absorption and re-emission of photons by the atoms, which results in an effective slowdown of light within the material.
The speed of light in a medium, such as diamond, is slower than its speed in a vacuum. The speed of light in a given medium is denoted by "v" and is related to the speed of light in a vacuum "c" and the refractive index "n" of the medium by the equation:
v = c / n
So, in a diamond, since the speed of light is slower (around 40% slower, as you mentioned), the refractive index of diamond (n) would be around 2.42.
When the light exits the diamond and returns to a vacuum or air, it will resume its original speed "c" (the speed of light in a vacuum) because there is no longer any interaction with atoms to cause delays. The photon doesn't accelerate to reach the speed of light; rather, it continues at the speed of light once it is no longer interacting with the medium.
In summary, photons always travel at the speed of light "c" in a vacuum and do not accelerate or decelerate. When light passes through a medium like diamond and slows down, it will resume its original speed "c" once it exits the medium and returns to a vacuum or another material with a lower refractive index.