Pemex gas stations are the only official outlets where you can purchase fuel in Mexico. These are full service stations and the attendant should handle the pump, and they will also check oil, tire pressure, etc., if asked.
Basic unleaded gasoline is called "Magna" and is measured in liters (1 gallon = 3.3785 liters).
Be prepared to pay for your fuel with cash. Although some Pemex stations close to the US border may accept US dollars, you should expect to pay for your fuel with Mexican currency.
Be aware that some gas stations in Mexico have been known to attempt certain 'rip-off' ploys. To avoid being ripped-off, make sure the fuel pump is set to $0.00 when you begin fueling. Also, pay attention to how much change you should receive in return when paying for your fuel. Gas station attendants have been known to intentionally give tourists the incorrect amount of change.
If you ask the attendent to do any extras like check your oil or tire pressure, a tip 5-10 pesos (~50 cents - $1) is customary.