The Short Answer
Any cocktail that involves citrus juice, egg, sugar-thickened liqueurs, or cream should be shaken; any cocktail made up of only clear spirits should be stirred.
The Long(er) Answer
When to stir: Cocktails made up of only clear spirits (like Manhattans, negronis, and martinis, James Bond's drink of choice) should be stirred to preserve the alcohol's crystal-clear appearance, as vigorous shaking will dilute the liquid with cloudy ice crystals.
When to shake: Shake it up when working with citrus juice and viscous liquids (whole egg or egg white, cream, sugary liqueurs, etc.) that need more elbow grease to evenly distribute throughout the drink. Just make certain to add carbonated beverages to the drink after it's been shaken (and give it a little stir to incorporate) unless you're looking to make a big fizzy mess.
When to roll: Cocktails should be rolled (gently inverted in a cocktail shaker about 10 times) if they include delicate herbs that might bruise from more agitation but would otherwise be shaken, like in a celery southside. Additionally, simple cocktails that are served on the rocks (like a screwdriver) should be rolled, as excessive shaking or stirring will overdilute the cocktail, since the melting ice cubes will contribute to dilution.
As for equipment, we're partial to Boston shakers
($35) for shaking, as they tend to leak less. Plus, both their glass and metal tins can serve double duty as the vessel for stirring cocktails using a slender but sturdy cocktail spoon