How do we dampen a spring-mass system with respect to time?
In cases like this it is always beneficial to plot the things we are talking about. The red curve is just the cosine wave and the green one is a cosine wave multiplied by an exponentially decaying envelope which is shown in blue.
Since the time between two troughs is the time period $T$, then the ratio of displacements at two instants of time separated by a time $T$ will be given by $e^{-\lambda T}$.
Physically what this the green curve is telling us is that the periodicity is unchanged however the amplitude is decaying over time. The oscillator isn’t going as far as it initially did. And this is what happens during damping. We would want to capture the rate of this amplitude decay in some neat mathematical form, thus the $e^{-\lambda T}$. This $\lambda$ is exactly the rate of decay of the amplitude.
Start with the equations of motion
$$ m \ddot{x} = -k x - d \dot{x} \tag{1}$$
where $m$ is mass, $k$ is stiffness (force/distance) and $d$ is damping (force/speed).
Parametrize the problem with $k = m\, \omega_n^2$ and $d =2 \zeta m\, \omega_n$ where instead of specifying $m$, $k$ and $d$, you specify a system with $\omega_n$ undamped natural frequency and $\zeta$ damping ratio.
The equations of motion are
$$ \ddot{x} = -\omega_n^2\, x - 2 \zeta \omega_n\, \dot{x} \tag{2}$$
with the well known solution of the type
$$ x= X \exp\left(-\lambda t\right) \sin \left( \omega t \right)\tag{3}$$
with $\lambda = \zeta \omega_n$ and $\omega = \omega_n \sqrt{1-\zeta^2}$.
Expanded this is
$$ x= X \exp\left(-\tfrac{d}{2 m} t\right) \sin \left( t\sqrt{\tfrac{k}{m}-\tfrac{d^2}{4 m^2}} \right)\tag{4}$$
provided that $ d \leq 2 \sqrt{k m}$.
The solution for higher damping is
$$ x= X \exp\left(-\tfrac{d}{2 m} t\right) \sinh \left( t\sqrt{\tfrac{d^2}{4 m^2}-\tfrac{k}{m}} \right)\tag{6}$$