That question is usually asked by someone who is flying into one of the airports, and intends to fly out of the other airport on the same day.
In which case the answer is: Don't do this unless you have no alternative and have a large number of hours to spend. You need to allow for:
- Your incoming flight being late
- Landing and taxiing
- Walking through long corridors (both Gatwick and Heathrow are good at this)
- Delays at Immigration (30-60 minutes not unusual)
- Picking up luggage and walking through customs
- Exiting and finding the bus
- Bus trip - nominally 1h 5 mins, unless it is a bad day on the M25
- Whatever minimum check-in time applies for your second flight.
A pre-booked private taxi will be no quicker, it still has to take the same route along the M25.