Mountain Bike (MTB)
Mountain bikes are typically ridden on mountain trails, fire roads, logging roads, and other unpaved environments. These types of terrain commonly include rocks, washouts, ruts, loose sand, loose gravel, roots, and steep grades (both inclines and declines). Mountain bikes are built to handle this terrain and the obstacles that are found in it like logs, vertical drop offs, and smaller boulders. There are two types of mountain bikes: Hardtail, which do not have a rear suspension; and full-suspension ones, which have front and rear suspensions. Hardtail bikes transfer pedaling power to the rear wheel more efficiently than full suspension models. On non-technical surfaces, this results in better acceleration and makes it easier to sustain higher speeds over a long time (if you're just starting out, on a really tight budget, or just enjoy simplicity, you should definitely consider a hardtail). Full suspensions, on the other hand, are good for bumpy or technical downhill trails. Rear suspension allows more of the available rear wheel to actually reach the ground by allowing the wheel to better articulate over obstacles.
Road
Yes, all bikes can ride on roads. However, a road bike is one that's optimized for riding on smooth pavement. It usually has skinny tires and are built for traveling at speed on paved roads. Some road bikes are called Hybrid.
Gravel
Go for a gravel if you want to get some of the best bits of mountain and road bikes all in one package. With an upright, comfortable and stable riding position, gravels also give an efficient experience on roads.
Urban/City/Commuting
Designed with city streets in mind, urban bikes are rugged and sturdy with tough frames and strong wheels. They are the obvious choice for urban commuters.