The solvent used in substitution reactions inherently determines the nucleophilicity of the nucleophile; this fact has become increasingly more apparent as more reactions are performed in the gas phase. 
As such, solvent conditions significantly affect the performance of a reaction with certain solvent conditions favoring one reaction mechanism over another.  For S1 reactions the solvents ability to stabilize the intermediate carbocation is of direct importance to its viability as a suitable solvent.  The ability of polar solvents to increase the rate of S1 reactions is a result of the polar solvents solvating the reactant intermediate species, i.e., the carbocation, thereby decreasing the intermediate energy relative to the starting material.  The following table shows the relative solvolysis rates of tert-butyl chloride with acetic acid (CHCOH), methanol (CHOH), and water (HO).
The case for S2 reactions is quite different, as the lack of solvation on the nucleophile increases the rate of an S2 reaction. In either case (S1 or S2), the ability to either stabilize the transition state (S1) or destabilize the reactant starting material (S2) acts to decrease the ΔG and thereby increase the rate of the reaction.  This relationship is according to the equation ΔG = –RT ln K (Gibbs free energy).  The rate equation for S2 reactions are bimolecular being first order in Nucleophile and first order in Reagent.  The determining factor when both S2 and S1 reaction mechanisms are viable is the strength of the Nucleophile.  Nuclephilicity and basicity are linked and the more nucleophilic a molecule becomes the greater said nucleophile's basicity.  This increase in basicity causes problems for S2 reaction mechanisms when the solvent of choice is protic.  Protic solvents react with strong nucleophiles with good basic character in an acid/base fashion, thus decreasing or removing the nucleophilic nature of the nucleophile.  The following table shows the effect of solvent polarity on the relative reaction rates of the S2 reaction of 1-bromobutane with azide (N).  There is a noticeable increase in reaction rate when changing from a protic solvent to an aprotic solvent.  This difference arises from acid/base reactions between protic solvents (not aprotic solvents) and strong nucleophiles.  While it is true that steric effects also affect the relative reaction rates, however, for demonstration of principle for solvent polarity on S2 reaction rates, steric effects may be neglected.
A comparison of S1 to S2 reactions is to the right.  On the left is an S1 reaction coordinate diagram.  Note the decrease in ΔG for the polar-solvent reaction conditions.  This arises from the fact that polar solvents stabilize the formation of the carbocation intermediate to a greater extent than the non-polar-solvent conditions.  This is apparent in the ΔE, ΔΔG.  On the right is an S2 reaction coordinate diagram.  Note the decreased ΔG for the non-polar-solvent reaction conditions.  Polar solvents stabilize the reactants to a greater extent than the non-polar-solvent conditions by solvating the negative charge on the nucleophile, making it less available to react with the electrophile.