The Tor FAQ's "What are Entry Guards?" entry does not describe the process by which a relay becomes a guard. The word "flag" is not mentioned anywhere in the FAQ index.
Arma's "The lifecycle of a new relay" post lists three general criteria:
Directory authorities assign the Guard flag to relays based on three characteristics: "bandwidth" (they need to have a large enough consensus weight), "weighted fractional uptime" (they need to be working most of the time), and "time known" (to make attacks more expensive, we don't want to give the Guard flag to relays that haven't been around a while first).