The first we have to know is the formula for the volume of a cylinder:

From the question, we have that
D = 3 inches --> r = 3/2 --> r = 1.5 inches
h = 7 inches
Then, we have that the volume is:

Then, the cylinder (glass) has a volume of 49.48 cubic inches.
If we know that there are 231 cubic inches in a gallon, we have that:

Then, from the result, we can say that the largest number of full milk glasses that he can pour from one gallon of milk is 4 glasses.