Is it an SN1 or SN2 mechanism?
If you are asked to determine whether the nucleophilic substitution goes through an SN1 or SN2 mechanism, look at the following criteria in the given order:
1) Check the substrate (alkyl halide most often): If it is a primary substrate, the mechanism is SN2.

2) If it is a tertiary substrate, then the mechanism is SN1 – No questions, you are done with this.

A reminder on how to classify substrates as primary, secondary, or tertiary:

Remember this reactivity chart of the alkyl halides in SN1 and SN2 substitution reactions:

Why can’t primary do SN1?
Now let’s understand why it is like this. If you were to do an SN1 mechanism on a primary substrate, you’d get a primary carbocation. Let’s draw a hypothetical SN1 mechanism. Remember, SN1 means the leaving group leaves, and only after that, the nucleophile attacks. That is the definition of the SN1 mechanism, it is a unimolecular mechanism, i.e. only one of the reactants (in this case the substrate) participates in the rate-determining step:

What you need to remember, to understand the problem with this mechanism, is that primary carbocations are very unstable and they are simply not formed under normal circumstances. So, this mechanism is impossible:
The only way to achieve a substitution is to involve the nucleophile and substrate at the same time in the rate-determining step:

And this, by definition, is the SN2 mechanism.
Why can’t tertiary do SN2?
Now let’s see why tertiary substrates can undergo SN1 reactions only. If you were to do an SN2 mechanism on a tertiary substrate you’d have to show the nucleophile attacking the substrate while the leaving group is still there (by definition of the SN2 mechanism). And again, let’s draw a hypothetical mechanism for this:

The problem here is that the nucleophile does not have space to access the carbon bearing the leaving group. This carbon is surrounded (sterically hindered) by the neighboring carbons, which block the access of the nucleophile:

The nucleophile has to wait till the leaving group is gone, and only then can it attack. Therefore, the rate of the whole process is determined (slowed down) by the loss of the leaving group, which is the rate-determining step in the SN1 mechanism.
So, to summarize:
If the substrate is primary – it is SN2
If the substrate is tertiary – it is SN1
What about the Secondary Substrates?
Now the secondary substrate – the troublemaker. For secondary substrates, the mechanism is determined largely by the nucleophile, and the principle here is that:
a strong nucleophile does SN2, while a weak nucleophile does SN1.
In simple words, a strong nucleophile means a reactive/aggressive/unstable nucleophile, so one that has a large electron density (lone pairs and especially a negative charge) and is not happy handling this electron density. Because it is reactive, it is not going to wait for the leaving group to leave before it attacks. It attacks and kicks out the leaving group:

In general, nucleophilicity increases with basicity, i.e, strong bases are better nucleophiles.

It might be a good idea to go over the acid-base chemistry and the pKa concept to recognize stronger bases. Here are the most common strong nucleophiles:

If, on the other hand, you have a weak nucleophile, choose SN1 as the primary mechanism for the reaction. A weak nucleophile means it is not as reactive and will not attack unless the leaving group is gone, and a carbocation is formed:

Once there is a positively charged carbon present in the solution, then the nucleophile attacks since, despite being weak, it still has sufficient electron density to attack the strongly electrophilic carbon of the substrate.
The two main nucleophiles are water and alcohols.
In addition to the nucleophile, the solvent also plays a role in determining the major mechanism in nucleophilic substitution reactions. Here, you need to remember that polar aprotic solvents favor the SN2 mechanism, while polar protic solvents favor the SN1 mechanism.
These two types of solvents are given in the table below.

Determining SN1 or SN2 based on the stereochemistry of the product
In some cases, you may be asked to determine the mechanism based on the structure, mainly the stereochemistry, of the product.
Two important features you need to remember for this:
- SN2 mechanism goes through inversion of configuration
- SN1 mechanism goes through the racemization
Here, we are talking about the absolute configuration of the electrophilic carbon (the one connected to the leaving group).
So, if you see the product as one stereoisomer (i.e., it is shown as a wedge or a dash – more accurately, it is either R or S), then you know that it must have been an SN2 mechanism:

If the product is shown as a mixture of two stereoisomers (R and S of the electrophilic carbon), then the mechanism had to be SN1:

Sometimes, the chiral center may be shown with a plain or a wiggly line and this indicates that it can be a wedge or dash, meaning it is a mixture of R and S configurations.

