Time measured by a person vs Time measured by the same person as observed from another frame

Consider the definition of length. We may define it as the difference of the spatial coordinates between two points with respect to a reference frame, when it's temporal coordinates are the same. Basically length is the distance between two points when they are at the same time coordinate.

Thus the relationship between length with respect to two different reference frame may be obtained using the Lorentz Transformation for the spacial coordinates.

Consider, the following scenario, two reference frames A and B. A is stationary, while B is moving with a constant velocity v with respect to A. We assign x and t to the reference frame A, x' and t' to reference frame B.

Note I will be taking $c=1$ to the end.

Now consider at some t', we measure a length l with respect to B. The length will be equal to

$$l=(x'_p-x'_o)$$

Now let's write down the transformation equations for $x'_p$ and $x'_o$.

$$x'_p=\frac{x_p-vt}{\sqrt{1-v^2}}$$

And

$$x'_o=\frac{x_o-vt}{\sqrt{1-v^2}}$$

Now we know how x transforms and hence we will substitute them into our transformation equations.

Here I will consider a simple example, however it can be generalised further. For simplicity, let's consider measurements made at t'=0, between the points x'=0, and x'.

$$x'=\frac{x-vt}{\sqrt{1-v^2}}$$

Now as we have taken $t'=0$, we may imply that $t=vx$ and from here we can rewrite our transformation equation as

$$x'=\frac{x-v^2x}{\sqrt{1-v^2}}$$

This is going to give us

$$x'=x\sqrt{1-v^2}$$

Adding the speed of light in we get

$$x'=x\sqrt{1-v^2/c^2}$$

Now by our definition what is x'? Length as measured by the moving frame, what is x? Length as measured by the stationary frame. The key here is in the definition of length and time, which brings in the concept of length contraction, and time dilation

A more clear explanation is given by Leonard Susskind, in The Theoretical Minimum lecture series.

Also here is a special relativity space time graph, which works on the principles of Lorentz transformations, which will physically show how the effects take place