We have analysed BAT and XRT data for 40 gamma-ray bursts (GRBs) observed using the Swift satellite. The earliest X-ray light curve can be well described by an exponential which relaxes into a power law, often with flares superimposed. The transition time between the exponential and the power law gives a physically defined timescale for the burst duration. In most GRBs the power law decay changes to a shallower decay within the first hour. The resultant "late emission hump" can last for several tens of ks. In other bursts the late hump is weak or absent. The observed variety in light curve shape can be explained as a combination of three components: prompt emission from the central engine; afterglow; and the late hump, which may also be due to the central engine. GRBs with stronger afterglow components are more likely to have brighter early optical emission. The late emission hump can have a total fluence equivalent to that of the prompt phase.