Gatwick has North and South terminals linked by a free automated shuttle. The railway station is at the South Terminal.
South Terminal
The railway station is attached to the South Terminal. British Airways and many other carriers use South; always check the current assignment before travelling.
North Terminal
North Terminal serves easyJet and many long-haul carriers. It is linked to South Terminal and the railway station by a free automated shuttle.
Check before travel
Terminal assignments are airline-specific and occasionally operationally complex — TUI, for example, can use both terminals depending on flight number. Use Gatwick's live terminal finder.