The trains from Gatwick run all night, but after about 2330 there can be some big gaps in service of up to one hour. Trains do not run to Heathrow all night, they stop between about midnight and about 4am, and the Tube operates to similar times unless it's a Friday or Saturday night and Night Tube is running.
A poster further up suggests the area around Farringdon, but that station is also closed between about 0030 and about 0430.
I would stay at Gatwick. If you don't fancy Gatwick, I have stayed at the Premier Inn next to East Croydon station many times, it's good enough for what it is and it is priced competitively compared to central London. But you still have the risk of a long wait at Gatwick if you just miss a train.