Phase Margin is defined as the phase difference between ∠βA(f0dB) and -180°, where f(0dB) is the frequency at which |βA|=1.
Gain Margin is defined as the difference between 0dB and |βA| where the loop gain phase is -180°. Gain and phase margins are used to determine if the amplifiers are stable or not. If the phase margin is less than 0° , it indicates instability and oscillation. if the phase margin is larger than 0°, it indicates the opposite, i.e. stability.