What is must-have gear for mountain biking?
For long rides of 1-3 hours, I carry the following:


Tube + mini pump (CO^2 if you want, tire leavers for new or difficult tires)
Mini tool with allen keys, spoke key and a chain tool
Water
Snack


For longer trips, you'll want to consider panniers (carry bags) and a hydration pack so you'll be able to carry the load more effectively. In general, advice on backpacking trips should apply.