Why would the car air conditioner not work car when it idles for 5 hours?

AC operation depends on air flow through the evaporator. At idle only the cooling fan is pulling air through and it is not enough. I cannot imagine why you would idle a car for 5 hours though but you may need a recharge, the system should be able to cool it a little at idle but not well until you get moving