High-order harmonic generation (HHG) in gases is known to benefit from using mid-infrared driving laser fields, since, due to a favorable wavelength scaling of the electron ponderomotive energy, higher-energy photon production becomes feasible with longer-wavelength drivers. On the other hand, recent studies have revealed a number of physical effects whose importance for HHG increases with increasing laser wavelength. These effects, as a rule, result not only in a general decrease of the harmonic yield but also in a reshaping of the emission spectrum. Therefore, detailed study of the dependence of HHG yield on the laser wavelength has become an important issue for producing intense extremely short extreme ultraviolet (XUV) and x-ray pulses using HHG driven by long-wavelength laser fields. Here we address this issue by calculating the HHG spectra for laser wavelengths ranging from 2 to 20 µm. This study has been carried out in a frame of strong-field approximation modified properly to take into account the effect of the magnetic field of a laser pulse on the dynamics of the field-ionized electron and the atomic bound-state depletion. We show that different regions of the HHG spectrum behave differently with the laser wavelength and discuss the origins of this behavior. In particular, we show that in a weak ionization regime, the dipole-approximation scaling law for the harmonic yield, which is calculated as the integral over the spectral interval of fixed width and relative position with respect to the cutoff energy, obeys the power law, where the absolute value of the exponent is an integer equal to $\mu = {7}$μ=7 for the cutoff and $\mu = {8}$μ=8 for the plateau harmonics. Above a certain critical wavelength, due to the nondipole effects, the efficiency of HHG decreases more strongly than according to a power law, and this decrease is different for different regions of the spectrum. The analytical formulas are derived that match well the calculated wavelength scalings.