This is called a "lightclock." Because the distance between the mirrors is constant, and the speed of the photon is constant, the "clicks" can be used to measure time. It will click approximately 1 billion times per second. 35 billion clicks, therefore, would equate to 35 seconds. Now add to the experiment a second light clock, but this one will be moving parallel relative to the first stationary one. From the point of view of the stationary lightclock, the photon in the moving lightclock will appear to take the following path:
The dotted lines trace the path of the photon between the 3 observed positions. The dotted lines are longer than the 6 inches between the mirrors, which means the photon has travelled a longer path. Because the speed of the photon is fixed at the speed of light, and the distance has grown, that means the clicks will be farther apart, meaning the "clock" will tick slower! To the stationary observer, this means time itself appears to pass more slowly for the moving clock. In fact, the faster the clock moves, the slower time appears to pass.
The fascinating thing about the theory, is that the velocity of each object is measured according to the other. In other words, either clock can claim that it is stationary and that the other is moving. Furthermore, each can say the other is experiencing time more slowly, and be absolutely correct!