Fundamental number two: you must be pedaling when you change gears. That's because the chain has to be moving in order for the derailleurs to "de-rail" the chain from sprocket to sprocket. That's also why it's best not to click the shifters when you’re sitting still. Besides stretching the gear cables, the bike immediately changes gears when you start off again, usually with some very disconcerting noises. Shifting your gears while sitting still is like fingernails on a chalkboard to your bike mechanic.
Now back to the gear shifting tips.
Tip one: Pedal at a brisk pace. It’s better to pedal at a brisk pace using the easier to pedal gears than to muscle the harder gears more slowly. This technique will increase your stamina over a longer ride and will enable you to accelerate more quickly if you need to "jump". I promise you’ll still get a good leg workout. A brisk pace on the pedals also improves the shifting.
Tip two: And this is hugely important. Lighten the pressure on the pedals when you shift. Keep them turning, but don't be muscling down on them while you shift. Lightening the pressure on the pedals significantly smoothes the gear change, reduces those grinding noises when you shift, and lengthens the life of your drive train. You’ll have to anticipate your shifts a bit as you approach the hills, but it only takes a beat to change your gears on a hill once you get your timing down.
Tip three: Avoid using the small ones in the front with the small ones in the back. Another way to say the same thing is, when you’re chain is on the inboard ring on the front, it should be on the inboard cogs in the back. Similarly, when you’re chain is on the outboard ring on the front, it should be on the outboard cogs in the back.
Tip Four: Remember to shift back to a low gear before you stop so that you’ll be in an easy gear for starting out again.
When to change gears will be pretty obvious. You’ll want to shift to an easier pedaling gear (i.e. down shift to a lower number) when the bike gets hard to pedal up hills, and then shift to a higher gear (higher number) so your pedals can catch up when you go down one. Thus, we have come full circle on our gear shifting discussion. Gears make it easier to go up hills and let you pedal down them.
Source: Intown Bicycles/photo from bicycleparts.us