Magnetic semiconductors have aroused interest due to their various functionalities related to spintronic devices. Manganese (Mn) as a substitutional impurity in A3B5 semiconductors supplies not only holes, but also localized spins. The ejection of Mn atoms with an uncompensated magnetic moment leads to the appearance of ferromagnetic properties. The most suitable material characterized by long-term spin dynamics is n-type GaAs. In p-type GaAs, the spin relaxation time of electrons is generally much shorter. For purposes of this research, electron-spin relaxation times in 3D and 2D p-type GaAs were studied. Calculation of impurity densities and charge state of magnetic acceptors demonstrate the essential composition of the material. Comparison of theoretical and experimental data in optical-spin orientation of electrons reveal the longest spin relaxation time of 77 ns in 2D GaAs:Mn, less than twice the best time in the p-type 3D GaAs material.