Upgrades are done by computer on a space-available basis (upgrade space, not just empty seats), as early as 48 hours before departure if you are Gold.
Until the gate agent manually clears people into the remaining seats as part of closing the flight (usually 60 minutes or less before departure), humans are not directly involved in clearing individual upgrades.
Historically the computer would clear everyone at T-24 except the last two seats, but I don't think that has been true recently.