Reaction mechanism (SN2 and SN1 reactions)
SN1 is characterized by the possibility of formation of a stable carbocation during the reaction, whereas in the case of SN2 there cannot be formed a stable carbocation, so the most stable "intermediate" structure would be a transitional state. Stable carbocations are formed via groups with strong inductive electronic effects (+I those that repell electrons) or they can be stabilized by conjugation (the case for this one is when you have a double, triple bond or an aromatic ring directly bound to the carbon atom where the substitution takes place)
so, for example, (CH3)3C-Cl would make for an SN1 when reactiong with alcohols. Also compounds like CH2=CH-CH2-Cl.
The remaining cases, for example CH3-Cl or CH3-CH2-Cl would work via SN2, because the carbocation cannot be stabilized.
Hope that's gonna help you :)