The imperial gallon is a unit for measuring a volume of liquid or the capacity of a container for storing liquid, not the mass of a liquid. Thus, a gallon of one liquid may have a different mass from a gallon of a different liquid.
An imperial gallon of liquid is defined as 4.54609 litres, and thus occupies a space equivalent to approximately 4,546 cubic centimetres (roughly a 16.5cm cube).
The U.S. liquid gallon and the U.S. dry gallon are different units defined by different means. The U.S. liquid gallon is defined as 231 cubic inches and equates to approximately 3.785 litres. One imperial gallon is equivalent to approximately 1.2 U.S. liquid gallons.
The U.S. dry gallon is a measurement historically applied to a volume of grain or other dry commodities. No longer commonly used, but most recently defined as 268.8025 cubic inches.