Solvents can be broadly classified into two extremes; polar and non-polar. Chemist use the dielectric constant (ε) as a measure of polarity, however, you should be able to look at the structure of a solvent and guesstimate its polarity and and other properties. Water (ε=78) is the most polar and alkane solvents are the least polar. Everything else falls in between.
Polar solvents can also be classified further as protic or aprotic. Polar protic solvents are easy to recognize, since they have -OH group and include acetic acid, formic acid, methanol and ethanols and other alcohols. Aprotic solvents don't have -OH and include DMSO (Dimethyl sulfoxide), DMF (N,N-dimethylformamide), acetone, acetonitrile (CH3CN).
Polar reactions with charged intermediates such as the SN1 and SN2 are favored by polar solvents. Typical solvents for SN1 include water, formic acid and alcohols (very polar solvents), while the SN2 reaction favors slightly less polar aprotic solvents such as (acetone, acetonitrile, DMF and crown ethers).
In this pathway, the rate-determining step usually involves the formation of ions and the rate of this process will be increased by a polar solvent. You could explain this by using Hammonds postulate. Since these are up hill reactions (endothermic) the transition should resemble the products and would be carbocation like. Thus very polar solvents should provide best stabilization of the this polar transition state. This is a transition state effect.
The SN2 reaction favors slightly less polar aprotic solvents such as (acetone, acetonitrile, DMF). A very polar protic sovent will decrease the reactivity of you nucleophile by tieing up (solvating) the nucleophile. Thd following illustrates the interaction of water a polar protic (wrong solvent for SN2!) with NaBr. You don't want the Br- to be heavily solvated.
On the other hand a less polar aprotic solvent such as acetonitrile would not solvate the Br-. This is considered a ground state effect.