Context. In stratified atmospheres, acoustic waves can only propagate if their frequency is above the cutoff value. The determination of the cutoff frequency is fundamental for several topics in solar physics, such as evaluating the contribution of those waves to the chromospheric heating or the application of seismic techniques. However, different theories provide different cutoff values. Aims. We developed an alternative method to derive the cutoff frequency in several standard solar models, including various quiet-Sun and umbral atmospheres. The effects of magnetic field and radiative losses on the cutoff are examined. Methods. We performed numerical simulations of wave propagation in the solar atmosphere using the code MANCHA. The cutoff frequency is determined from the inspection of phase difference spectra computed between the velocity signal at two atmospheric heights. The process is performed by choosing pairs of heights across all the layers between the photosphere and the chromosphere, to derive the vertical stratification of the cutoff in the solar models.Results. The cutoff frequency predicted by the theoretical calculations departs significantly from the measurements obtained from the numerical simulations. In quiet-Sun atmospheres, the cutoff shows a strong dependence on the magnetic field for adiabatic wave propagation. When radiative losses are taken into account, the cutoff frequency is greatly reduced and the variation of the cutoff with the strength of the magnetic field is lower. The effect of the radiative losses in the cutoff is necessary to understand recent quiet-Sun and sunspot observations. In the presence of inclined magnetic fields, our numerical calculations confirm the reduction of the cutoff frequency due to the reduced gravity experienced by waves propagating along field lines. An additional reduction is also found in regions with significant changes in the temperature, due to the lower temperature gradient along the path of field-guided waves. Conclusions. Our results show solid evidences of the stratification of the cutoff frequency in the solar atmosphere. The cutoff values are not correctly captured by theoretical estimates. In addition, most of the widely-used analytical cutoff formulae neglect the impact of magnetic fields and radiative losses, whose role is critical to determine the evanescent or propagating nature of the waves.