The clearest difference is emphasized by two alternative names for mountain biking: Off-road biking or trail biking. It involves getting onto unpaved roads, trails, and terrain.
Beyond that, other differences frequently, but don’t always, exist. Mountain biking often involves hillier terrain than road biking, but it doesn’t have to. You can go road biking on a mountain bike (though it will take more effort); you’ll soon get in trouble, though, if you try serious mountain biking on a road bike.
The two activities are better thought of as different parts of a spectrum, rather than as entirely different activities. When we go biking in Iceland, for example, we use mountain bikes because the route includes everything from paved and unpaved roads to fields of volcanic ash. But most people would consider this more of a road biking than a mountain biking trip.