z = (x - mean) / standard deviation. A spread trading two points above a 20-day mean with a 0.8-point standard deviation has z = 2.5, which is comparable with a different pair whose numbers are in entirely different units.
Mean-reversion systems typically enter at |z| above some threshold and exit near zero. The threshold is a parameter like any other and should be checked for a parameter-plateau: if 2.0 works and 2.2 does not, you have fitted noise.
Caution: z-scores assume the mean and standard deviation are meaningful, which fails when the series is trending or non-stationary. On a trending series the z-score is permanently stretched in the direction of the trend, and the system sells strength forever.
Related: normalisation, mean-reversion, stationarity, trading-signal