This relates to two aspects:
First: how big is the load you are carrying? Generators usually automatically adjust the throttle. If the load is small, the operating time will be long. If the load is large, the running time will be longer.
Second: the size of the fuel tank, the size of the fuel tank. the generator should stop working when refueling! so what? A large fuel tank means a long operating time, and a small fuel tank means a short operating time!
For example: the fuel tank of Sarden 5KW diesel generator is 14L, and the fuel consumption per hour with 2KW equipment is 0.6L. It can work for 14 - 0.6 = 23 hours once on!