You are referring to rms (root mean square) velocity.
In any beam of particles there are two velocity distributions that may be of interest. Let's call them $f_1$ and $f_2$.
- If we propose a region R of space containing some long section of the beam then:
(number of atoms in R at some instant of time with velocity between $v$ and $v+dv$) = $f_1(v) dv$
- If we propose a plane P which the beam passes through and some interval of time $\Delta t$ then:
(number of atoms passing through P during $\Delta t$ with velocity between $v$ and $v+dv$) = $f_2(v) dv$
Many textbooks simply go straight to $f_2(v)$ here and don't really make it clear that both distributions are well-defined and each has its uses. Anyway one can show from some simple kinetic theory that
$$
f_2(v) \propto v f_1(v) .
$$
In a Stern Gerlach experiment you typically have a beam of atoms produced by free emission from a small hole at low density (this is called effusion) from a chamber in thermal equilibrium at some temperature $T$. Basic kinetic theory then gives
$$
f_1(v) \propto v^2 e^{-m v^2/2kT}
$$
and
$$
f_2(v) \propto v^3 e^{-m v^2/2kT}.
$$
In either case the proportionality constant can be obtained by normalizing the probability distribution.
Now we can calculate the mean square velocity.
For distribution 1,
$$
\frac{1}{2} m \langle v^2 \rangle =
\frac{1}{2} m \frac{ \int_0^\infty v^4 \exp(-mv^2/2kT) dv }
{\int_0^\infty v^2 \exp(mv^2/2kT) dv} = \frac{3}{2} k T
$$
For distribution 2,
$$
\frac{1}{2} m \langle v^2 \rangle =
\frac{1}{2} m \frac{ \int_0^\infty v^5 \exp(-mv^2/2kT) dv }
{\int_0^\infty v^3 \exp(mv^2/2kT) dv} = 2 k T .
$$
Which distribution to use depends on what kind of experimental observation one is making. In Stern Gerlach case one usually places a screen and measures how many atoms arrive on that screen during some interval of time, so the second distribution is the right one to use. If instead one detected the atoms by amount of fluorescence at any given time owing to illumination of a given length of the beam, then distribution 1 would be appropriate.
(As I say, many discussions of atomic beams omit case 1 here altogether, but it is better to be aware of both.)