What is the legal or regulatory definition of AOG (Aircraft on Ground)? For example, this is sometimes stamped on a repair order.
There is no regulatory definition of the phrase "Aircraft On Ground" as used in work orders or repair orders in the FARs (14CFR), it is used by convention to indicate that the order is urgent as the parts or repairs specified must be completed in order to fly the aircraft.
What causes the aircraft to be grounded can be a functional issue that (such as a damaged control surface: The aircraft is grounded until it's repaired or replaced) or a regulatory one (for example, an airspeed indicator is part of the Day VFR required equipment, if it fails even though the plane can physically fly it's not legal to do so - your new airspeed indicator would be an AOG parts order).
AOG is usually used to hurry up and easy the procedures such as for example the Customs Clearance, AOG stamped cargos are given high priority and so on