To find out how many oz bottles of liquid you need to make a gallon you would take the number of oz and times that by how many numbers needed to make 1 gallon.
For every gallon of liquid there are 128 ounces so to make 1 gallon out of 12 ounce bottles you would take 12 and multiply that 12 by 11 which would equal to 132 which is a bit more than 128 ounces.
So you would need around 10 and half or at least 11 twelve ounce bottles to make 1 gallon which you'd have some of the water leftover.
So if you need a gallon of water and have the water in 12 oz bottles you should have at least 11 of those 12 ounce bottles of water to make a gallon and you'll have a bit of the water left.