It really depends on the efficiency of the inverter. To deliver 5 watts, your 12 V battery must be able to deliver some 5/12 amps. At full charge that can be sustained for a max of 62.4 hours. Low efficiency inverters operate at something like 80% efficiency. Be conservative and say 50 hours.