The answer is ‘it depends’.
Major airports car rental agencies are open as long as there are arriving flights.
Some close when there are no flights, but they always have a way for you to return your keys and rental agreement. Just check when you rent the car.
Most non-airport agencies don’t operate 24X7, but in my experience they too have ways to return cars when they are closed. Just check when you rent the car.
I’ve returned cars at very strange times.
