The answer depends on many things. To be more specific, you need to know:
The initial state of the gallon of water.
- If the water is already frozen, the answer is: No time at all.
- The water temperature. Most of the time, you can assume that all of your water is initially of the same temperature, but maybe your case is different.
- The shape of the water. Is it compact, for example in a bottle, or distributed in many drops, as in a cloud, or does it coat a surface?
The dynamic properties of the environment of the water, including
- the radiation temperature - If it's in a warm place, it may never freeze.
- the pressure - If the pressure is low enough, the water may evaporate before it has a chance to freeze.
- any temperature and heat conduction properties of the medium or media that the water is in contact with, for example the walls of a container, gases such as air, other fluids, or vacuum.
In summary, this is not yet a question that has a definite answer, the question needs to be much more precise.