A mountain bike is a lot of fun although it does require some maintenance. You should always lube your bike 15 hours or so before riding, as quick jobs right before you take off normally doesn't get everything lubed. Some lube jobs will last for more rides, although if things get loud or shifting gets sticky, it's time to lube.
Here is how to lube your bike:
1. The chainApply a generous amount of mountain bike lube to your chain as you move the pedals around backwards. It also helps to find a spot to steady your hand such as the frame while you move the pedals around and around. Make sure you watch out for the cranks and chain rings as they move around.
2. Front DeraileurOn the front defaileur, lube the pivots. Use a spot of lube everywhere you can see movement when you move the shift lever.
3. Rear deraileurJust like the front deraileur, lube the pivots.
4. PedalsThere are some types of clipless pedals that will need to have the release mechanism lubed. You should only lube this mechanism if you have this type of pedal.
5. Everything into motionPedal around, shift your gears, and bounce your bike around. If you hear anything squeak, there's a moving part there are it should be lubed immediately.
6. Wipe it all cleanOnce you've lubed everything and wiped it all around, simply wipe it all back off. Use a rag to wipe away all the lube you used, including all the lube off the chain. Wiping it away will leave the lube in between the parts but clean it away from everywhere it isn't needed. This will keep your bike from collecting dirt while you ride.