Always check the side of the tire for the recommended tire pressure rating before adding air. In the past, it was acceptable to just feel the tire with your fingers, and that's still fine for a quick check. But that's not good enough if you're preparing for an extended ride. Mountain bike tires are designed with a specific pressure range. On the side of the tire there are embossed letters dictating the recommended tire pressure. It will usually be between 30 and 65 pounds per square inch (psi). Mountain bike tires are forgiving and will work at just about any pressure that doesn't exceed the highest number printed on the tire.
If you want to ride fast, put the highest amount of pressure into the tire according to the tire rating printed on the side. This allows the tire to ride up higher with a minimum amount of rolling resistance. For example, road bike tires typically run 120 psi or more for speed. This is way too much for mountain bike tires, but you can run 50 or 60 psi if the tire allows it. It should also be noted that you will lose traction with higher pressure in mountain bike tires. If you're riding on dirt where you can slide, use less than the highest recommended rating. If you're riding on pavement, it's fine to use the highest rating printed on the tire for efficiency and speed.
Lower-than-recommended tire pressure gives you more traction when climbing, or when you're riding in sand or loose material. Some mountain bike racers will run tires with only 20 psi. This is for proper "hookup" when climbing steep hills. The tire grips better and won't spin out. This won't harm your tire, but it will be less efficient on hard surfaces. If you're riding your mountain bike in town or on pavement, anything below 30 psi is not efficient and will make you work harder. If you're riding in the dirt, try starting out with pressure at the high end of the recommended rating. If you get into soft dirt or sand, you can always let some of the air out for better traction.
Mountain bike tire pressure can also be dictated by personal preference. Mountain biking for all types should start with a pressure of about 32 to 35 psi. If you weigh between 150 and 180 lbs., this pressure will be fine for most riding conditions. A general rule of thumb states that heavy riders need more pressure. Lighter riders should use less pressure. If your bike feels spongy and doesn't handle well, add more pressure but don't exceed the recommended rating. If your bike handles skittishly and feels rough and uncomfortable, try letting some air out of the tire for a softer ride.
Always carry an on-board air pump with you when riding your bike, as well as spare tubes and a patch kit. You never know when you're going to get a flat. These small pumps attach to the frame of the bike and should never be taken off except when you use them. You won't know how much pressure you're putting in the tire when using a hand pump and that's fine in emergencies. Just pump the tire up until it's firm enough to ride on. When you get back to civilization you can pump the tire up to its recommended pressure. Never use air compressors on mountain bike tires unless you are familiar with them. An air compressor can explode a mountain bike tire. Use extreme caution if you have no other choice.