You need to multiply the height of the wall you're painting by the width. It's likely that you'll be using different paints for things like baseboards, moldings and window or door frames, so be sure to subtract that area from your total. If you have access to the Internet, there are dozens of sites that have paint calculators, simple programs in which you fill in the dimensions of your walls and the size of windows and other exceptions. The site then tells you how much paint you'll need for each element of the job. There are some exceptions to all of this.
Cheaper paints tend to be much thinner and promise to cover a larger area.
But the quality of that coverage may not be good. Same thing if you're painting a porous surface like drywall. Unless you use a primer, the surface will soak up the paint. Once you've figured out how much paint you're going to need, don't skimp. You're painting because you want your room to have a fresh look.