We present a detailed study of Mg acceptor, p-type doping of GaN grown by plasma-assisted molecular beam epitaxy in both Ga-rich and N-rich conditions at low (∼580 °C) to high growth temperatures (∼740 °C). A growth map is constructed using results from a broad range of growth conditions, which shows the dependence of Mg incorporation and surface roughness on the III/V ratio and growth temperatures. Detailed secondary ion mass spectroscopy and atomic force microscopy studies confirmed that N-rich conditions are favorable for significantly higher Mg-incorporation efficiency (∼80%), whereas the Ga-rich growth condition is preferable for achieving a smooth surface morphology (root mean square roughness: ∼1–2 nm) with poor Mg incorporation. The room temperature Hall measurement confirms that the hole concentration in the range of ∼7 × 1017 to 2 × 1019 cm−3 can be achieved in Ga-rich and N-rich conditions, respectively, at a fixed Mg flux depending on the growth conditions. Our detailed study provides a proper guideline for realizing an efficient Mg-doped GaN layer and is applicable, in principle, to different nitride-based electronic and photonic devices.