The most important factor in determining which mechanism (SN1 or SN2) applies to an organic compound is the structure of the carbon skeleton. Most compounds that can form relatively stable cations generally do so and react via the SN1 mechanism, while the others have to react via the SN2 mechanism.
Cations are more stable if they are heavily substituted, but this is bad for an SN2 reaction because the nucleophile would have to thread its way into the carbon atom through the alkyl groups.
Which mechanism (SN1 or SN2) will the following compounds favour?
Think about the stabilizing effect alkyl groups can have, and also their role in terms of steric hindrance.
D. H. Aue, Wiley Interdiscip. Rev. Comput. Mol. Sci., 2011, 1, 487–508.