  We consider the dynamical off-equilibrium behavior of the three-dimensional
O$(N)$ vector model in the presence of a slowly-varying time-dependent
spatially-uniform magnetic field ${\bm H}(t) = h(t)\,{\bm e}$, where ${\bm e}$
is a $N$-dimensional constant unit vector, $h(t)=t/t_s$, and $t_s$ is a time
scale, at fixed temperature $T\le T_c$, where $T_c$ corresponds to the
continuous order-disorder transition. The dynamic evolutions start from
equilibrium configurations at $h_i < 0$, correspondingly $t_i < 0$, and end at
time $t_f > 0$ with $h(t_f) > 0$, or vice versa. We show that the magnetization
displays an off-equilibrium scaling behavior close to the transition line ${\bm
H}(t)=0$. It arises from the interplay among the time $t$, the time scale
$t_s$, and the finite size $L$. The scaling behavior can be parametrized in
terms of the scaling variables $t_s^\kappa/L$ and $t/t_s^{\kappa_t}$, where
$\kappa>0$ and $\kappa_t > 0$ are appropriate universal exponents, which differ
at the critical point and for $T < T_c$. In the latter case, $\kappa$ and
$\kappa_t$ also depend on the shape of the lattice and on the boundary
conditions. We present numerical results for the Heisenberg ($N=3$) model under
a purely relaxational dynamics. They confirm the predicted off-equilibrium
scaling behaviors at and below $T_c$. We also discuss hysteresis phenomena in
round-trip protocols for the time dependence of the external field. We define a
scaling function for the hysteresis loop area of the magnetization that can be
used to quantify how far the system is from equilibrium.
