The transits of a distant star by a planet on a Keplerian orbit occur at time intervals exactly equal to the orbital period. If a second planet orbits the same star, the orbits are not Keplerian and the transits are no longer exactly periodic. We compute the magnitude of the variation in the timing of the transits, δt. We investigate analytically several limiting cases: (i) interior perturbing planets with much smaller periods; (ii) exterior perturbing planets on eccentric orbits with much larger periods; (iii) both planets on circular orbits with arbitrary period ratio but not in resonance; (iv) planets on initially circular orbits locked in resonance. Using subscripts `out' and `in' for the exterior and interior planets, μ for planet-to-star mass ratio and the standard notation for orbital elements, our findings in these cases are as follows. (i) Planet-planet perturbations are negligible. The main effect is the wobble of the star due to the inner planet, and therefore δt~μin(ain/aout)Pout. (ii) The exterior planet changes the period of the interior planet by μout(ain/rout)3Pin. As the distance of the exterior planet changes due to its eccentricity, the inner planet's period changes. Deviations in its transit timing accumulate over the period of the outer planet, and therefore δt~μouteout(ain/aout)3Pout. (iii) Halfway between resonances the perturbations are small, of the order of μouta2in/(ain-aout)2Pin for the inner planet (switch `out' and `in' for the outer planet). This increases as one gets closer to a resonance. (iv) This is perhaps the most interesting case because some systems are known to be in resonances and the perturbations are the largest. As long as the perturber is more massive than the transiting planet, the timing variations would be of the order of the period regardless of the perturber mass. For lighter perturbers, we show that the timing variations are smaller than the period by the perturber-to-transiting-planet mass ratio. An earth-mass planet in 2:1 resonance with a three-dimensional period transiting planet (e.g. HD 209458b) would cause timing variations of the order of 3 min, which would be accumulated over a year. This signal of a terrestrial planet is easily detectable with current ground-based measurements.For the case in which both planets are on eccentric orbits, we compute numerically the transit timing variations for several known multiplanet systems, assuming they are edge-on. Transit timing measurements may be used to constrain the masses, radii and orbital elements of planetary systems, and, when combined with radial velocity measurements, provide a new means of measuring the mass and radius of the host star.