I will avoid invoking a certain secret agent in this post, but he has contributed a lot of confusion to this debate. “When should a cocktail be shaken, and when should it be stirred?”The general rule is that any drink that contains fruit juice, dairy, egg, or cream liqueur should be shaken, though the reason varies depending on the drink.
Drinks that contain egg white need to be shaken (shaken hard even) to ensure that the egg white completely denatures in the drink and builds a foamy texture. Otherwise your drink is more like something out of a Rocky training montage and that is not what we are going for.
Drinks that contain dairy or cream liqueurs are often shaken to provide dilution to keep a drink from being too thick, and also to ensure that they mix completely with the base spirit and other ingredients which are usually of much lower densities.
Drinks that contain fruit juices are shaken for the aeration that it provides. Tiny air bubbles are introduced to the drink that lighten it up and help to cut the sweetness of a drink by providing a hint of effervescence.
So how much of a difference does shaking a drink make versus stirring it? Quite a lot actually. Shaken drinks are about 10ºF colder than stirred ones, and they get almost 3 times the dilution that their stirred counterparts do. In fact it would take about 2 minutes of stirring a drink in order to reach the same level of dilution that 15 seconds of shaking can provide.
This slower rate of dilution is ideal for drinks that are made up of liquor, liqueurs, and bitters only. Such drinks rely on the interaction of subtle notes in each of their components that can be lost to over dilution. Though stirring for about 30 seconds is the rule of thumb, when you are comfortable with your setup and the drink you are making you can fine tune your stirring time to get a cocktail to taste just right.
If you really want to get into the science behind shaking vs stirring check out this article from Gizmodo.