The magnetization dynamics in diluted magnetic semiconductor heterostructures based on (Zn,Mn)Se and (Cd,Mn)Te has been studied experimentally by optical methods and simulated numerically. In the samples with nonhomogeneous magnetic ion distribution this dynamics is contributed by spin-lattice relaxation and spin diffusion in the Mn spin system. The spin diffusion coefficient of 7x10^(-8) cm^2/s has been evaluated for Zn(0.99)Mn(0.01)Se from comparison of experimental and numerical results. Calculations of the giant Zeeman splitting of the exciton states and the magnetization dynamics in the ordered alloys and parabolic quantum wells fabricated by the digital growth technique show perfect agreement with the experimental data. In both structure types the spin diffusion has an essential contribution to the magnetization dynamics.