If cost is the main thing you could also do:
- Bus from Heathrow to Feltham Station,
- Train from Feltham to Gatwick Airport (changing at Clapham Junction)
The train ticket FEL-GTW would be a day return for £13.40 (less if you have a rail card) and the bus journey £2 each way cash (£1 each way if you have Oyster pay as you go card).
However I would not do this with 3 hours to spare as it would only work safely if everything was timed perfectly - and it does not compare at all with the coach if you yourself don't know where you are going.