Gain margin indicates the distance, in dB, from the measured gain to a gain of 0 dB. Gain margin, on the other hand, is measured at the frequency where the phase shift equals -180°. In other words, how many degrees the phase must be decreased in order to reach -180°. Phase margin is a measure of the distance from the measured phase to a phase shift of -180°. This is commonly referred to as the “crossover frequency”.
Phase margin is measured at the frequency where gain equals 0 dB.