There are trains running 24 hours a day between Gatwick and London. It may not be the Gatwick Express, but I seem to recall the tickets are valid on Southern Trains (which are in any case cheaper). Use an Oyster or Contactless payment card to avoid being over-charged, it's valid on both services and the exit gates in Victoria apply the correct fare. There are also coach services during the night and with the road so empty it isn't much slower than the train. And the tube has been 24 hours a day for a year now.
If you are extremely late, BA are known to pay up to £50 in taxi costs.