This is an age old question. The answer it is that it all comes down to which paint are you using? How many coats do you want? I assume you will roll on and not spray. If you roll Promar 400 from Sherwin Williams you may need 3 coats. If you roll on Cashmere from Sherwin Williams you will probably be able to get away with 1 coat and a few touch ups if you know what you are doing. So, depending on the paint and method you can be between 1-3 Gallons. The good thing is you can always buy short and go back and get more if you need to. Mixing paint is pretty quick.
In general a gallon of paint will cover approx. 400 sq ft. So figure the square footage of the room you’re painting (wall height X length) + ceiling 18X12 and that will give you total square footage. Divide by 400 and that’ll get you a close idea. Remember also, light over dark or dark over light will in general take two coats. I like to get more than enough, there’s nothing worse than running out in the middle of a wall.