How do airports charge airlines for using their gates?
Gates are usually not charged to airlines separately. Gate fee is usually part of the landing fee package. Landing fees are an important part of the airport revenue, with passenger fees.

Airport pricing is subject to recommendations from ICAO, IATA, and other organizations, as regard scope of costs to be taken into consideration, and non-discrimination of airlines. Pricing is determined by the organization managing the airport and/or State or local administration.

Single till vs dual till: Distinguishes between aeronautical and non-aeronautical (commercial) charges. Airport schedule pricing may use single or dual till. See: Single till - IATA.

ICAO Policies on Charges for Airports and Air Navigation Service. ICAO guidelines tries to maintain some principles for airport business across all countries:


Landing charges: Should be based on the aircraft weight formula. The maximum certificated take-off weight as indicated in the certificate of airworthiness (or other prescribed document) should be used, while considering local restrictions that may affect aircraft maximum take-off weight. Allowance should be made for the use of a fixed charge per aircraft or a combination of a fixed charge with a weight-related element, in certain circumstances, such as at congested airports and during peak periods.
Parking and hangar charges: For the determination of charges associated with use of parking, hangar and long-term storage of aircraft, maximum permissible take-off weight and/or aircraft dimensions (area occupied) and length of stay should be used so far as possible as the basis.Any period of free parking time for aircraft immediately following landing should be determined locally by considering aircraft scheduling, space availability and other pertinent factors. 
Other charges:

-- Passenger service charges
-- Security charges
-- Noise-related charges
-- Emissions-related aircraft charges  


Albeit a bit old, The Airport Business by Rigas Doganis has a chapter on Aeronautical charges and pricing policies which discusses this topic in depth. Extracts:


Landing fees: Charged per aircraft, usually based on MTOW (maximum takeoff weight). On most airports covers ATC, runways, taxiways, parking at stand or apron for a certain time (e.g. 2 hours), use of gates / fingers / terminal for disembarking (use for departure may be paying), take-off.
Surcharges or rebates in addition of landing fees: For noise, peak-hour operations,
Parking and hangar: Beyond the free-parking period covered by the landing fees. Usually based on weight.
Passenger charges: per departing passenger, sometime per arriving passenger too.


It is easy to find pricing for airports online.

Adelaïde airport (2015)


Rates are different for domestic and international flights.
Charges per passenger for landing and passenger facility. 
For domestic flights, additional landing charges per ton of MTOW.
Charges for diversion.
Parking charges beyond 2 hours, paid per arrangement with airport.


New York LaGuardia (2015)


Charge for aircraft landing, per thousand pounds of MGLW (maximum gross landing weight).
Additional charge for day landing or takeoff (not for schedule airlines).
Charge for using public passenger ramp and apron area (in some cases, when congestion).
Charge for parking and storage, per 8-hour slot, based on MGTOW (maximum gross takeoff weight). Agreement possible for operators of aircrafts.
No charge for air terminal use.
Charge for each passenger departing.


Los Angeles Intl (2013)


Landing fee, based on MGLW, different between permitted and non-permitted air carriers.
No charge for remote gates bussing service.
Charge for using ramp, apron and remote area, (in some cases, when congestion).
Charge for parking, per 1000 lbs of MGLW, per day, after 3 hours.