dernier /dernière
prochain /prochaine

Place 'dernier' after a noun (usually a unit of time) if you want to make a statement about a point of time in the past.

L'année dernière, mes parents m'ont donné une nouvelle voiture.
Last year, my parents gave me a new car.  

Le semestre dernier, j'ai reçu une contravention pour excès de vitesse.
Last semester, I received a speeding ticket.  

La semaine dernière, j'ai démoli la voiture dans un accident grave.
Last week I totaled the car in a bad accident.  

 

Coming after the noun, 'Dernier' locates an event in the past, using the present as a reference point.

'Prochain', in a similar way, locates an event in the future, using the present as a reference point.

La semaine prochaine, mes parents vont m'acheter une nouvelle voiture.
Next week, my parents will buy me a new car.  

Le mois prochain, je recevrai une nouvelle contravention.
Next month, I will receive another ticket.  

Et le semestre prochain, j'aurai encore un accident parce que je conduis comme un fou.  
And next semester, I will have another accident because I drive like a maniac.  

The present is the anchor, the reference from which 'dernier' and 'prochain' are measured. As such, they are only used with time expressions (l'an, l'année, l'été, le mois, la semaine, etc.).

Place 'dernier' before a noun if that noun is part of a list or a series. The series will act as a reference point.

La dernière année de sa vie était sa plus heureuse.

In this case 'la dernière année' is not 'last year' (the year before this one), but 'the last year of her life' (i.e. the last of a series, the last year in the series of years that make up her life).

Coming before the noun, 'dernier' will always refer to a series.

Le dernier livre que j'ai lu s'appelle Deux Mondes.

J'ai perdu mon dernier match de football.

The reference point is no longer the present but the series of soccer matches I've ever played. In fact, the relationship with the present is no longer mentioned (we have no idea when the match took place), and in these cases 'dernier' can be used with the future, and 'prochain' with the past.

Après l'exécution de Catherine Howard en 1542, la prochaine femme de Henri VIII s'appelait Catherine Parr. Elle était la seule à lui survivre.
(After the execution of Catherine Howard in 1542, Henry VIII's next wife was called Catherin Parr. She was the only one to survive him.)

Dans ma dernière classe à l'université, je vais entarter mon professeur de français.
In my last class at university, I'm going to throw a cream pie at my French teacher.  

Further points

-A 'dernier' or a 'prochain' which precedes the noun doesn't have to be used with a time expression:

Le dernier gâteau que j'ai mangé était délicieux.
The last cake I ate was delicious.  

-Usually a 'dernier' or a 'prochain' which precedes the noun includes a phrase which refers to a series:

         La dernière femme de Henri VIII  (The series is the wives of Henry VIII.)

         Le dernier gâteau que j'ai mangé  (The series is all the cakes I have eaten.)

However, if the 'series' can be understood from context, it doesn't have to be mentioned explicitly (although it should be understandable).

Le prochain examen sera moins difficile.
The series is implied: all exams to be taken this semester.  

-To express a 'dernier' or a 'prochain' coming after the noun, in English we would say 'last year' (no article), whereas to express the second kind of idea, 'la dernière année (de sa vie)', we would say 'the last year (of her life)'.

 

In summary

after the noun:

dernier = the most recent
prochain = the next one coming up

before the noun:

dernier = the latest in a series
prochain = the next in a series