I fly fairly often and usually on American, and I've never heard first class upgrades available for sale at the gate. You were very lucky to have the opportunity!
Usually, American first class upgrades are available only to Gold, Platinum and Executive Platinum AAdvantage members. These fliers are eligible for complimentary upgrades when traveling on a full-fare (Y or B class) coach ticket and can use electronic certificates to upgrade other tickets. Electronic upgrade certificates are good for 500 miles (or a fraction thereof) each and cost $25 each online (they are more at the airport) or 35,000 miles for eight. Elite members also get four free upgrade certificates for every 10,000 miles flown. It'll take a lot of certificates for a flight to Alaska.
Non-elite AAdvantage members also can purchase electronic upgrade certificates, but they are good only to upgrade a full-fare ticket to the next class of service.
If you're in any of the categories above, you can request an upgrade at the time of booking. When they will start processing your request depends on your status. Executive Platinum members get first dibs at 100 hours before the flight, Platinum at 72 hours and Gold/non-elite at 24 hours. They will continue processing your request until a few hours before flight time and you can get on the upgrade standby list for any last minute seats if you don't get an upgrade in advance.
If you're an elite member, the best option is to register on the aa.com site, purchase electronic upgrades and make your upgrade request online. The same applies for non-elite members, but remember that you'll only be eligible for an upgrade if you're on a full-fare ticket.