1 gallon equals 128 ounces so to make a gallon you would take 8 x 16 which is 128 that would mean that you'd need 16 8 ounce glasses to fill a gallon.
For health it's recommended to drink 8 eight ounce glasses of water per day which would mean you would drink 1/2 gallon of water per day.
Of course if you want to drink 16 glasses of 8 ounces of water per day then that would mean you'd drink 1 gallon of water which is okay if you're very thirsty and need the water to stay hydrated.
So in short you need 16 8 ounce glasses to make 1 gallon.