Starting from London City airport, assuming you're travelling with hand luggage only, it's possible to be standing on the DLR platform 10 minutes after wheels down! It's not a big, slow airport, it's a small and quick one.
From LCY, your main public transport is the DLR (Docklands Light Railway), though there are also taxis etc (see this FlyerTalk FAQ post for details). Trains are pretty frequent. You can use the TFL Journey Planner to look up the options based on exactly when you arrive.
For Heathrow, you'll take the DLR to Canning Town, then change onto the Jubilee Line. You then have two options. Quicker + more is expensive is take a cross-platform change at Baker Street to the Bakerloo line, take that to Paddington, then take the Heathrow Express train to T1/T2/T3 or T5. Tubes are every few minutes, Heathrow Express every 15 mins, journey time about an hour. Alternately, change at Green Park with a moderate walk, and take the Piccadilly line direct to Heathrow (all terminals). This will take about 1 hour 20 to 1 hour 30 minutes, unless you get lucky with connections / walk very fast. However, it'll be much much cheaper!
For Gatwick, your best bet is DLR to Canning Town, Jubilee Line to London Bridge, then a Thameslink train down to Gatwick. This also takes about an hour, and there are trains from London Bridge to Gatwick every 15 minutes. However, these trains are local commuter services, and are more likely to suffer disruptions or delays than the "premium" Heathrow Express. Cost wise, it'll be more than the tube to Heathrow, but less than tube+HEX.
(Exact costs depend on the time of day, if you have an Oyster card, and if you have a suitable UK railcard, most journey planners will let you calculate it for your situation)
Time wise - not much in it. Cost wise - depends which route, but Heathrow offers the cheaper one if you don't mind a slightly longer trip.
Most likely I think it'll be the onward flight connections that'll swing it for you!