To express "lengthen an essay", I would personally use "rallonger la composition".
According to Larousse definition:
Accroître la longueur de quelque chose : Rallonger un article de quelques lignes.
It is a very close synonym of "allonger" (and nowadays, I think you can use both as you wish), but it expresses the idea of adding something. The definition I linked above states:
Allonger = rendre plus long ou faire paraître plus long.
Rallonger = rendre plus long en ajoutant quelque chose.
But it's a subtle difference. Back to your question.
What is the difference between allonger and prolonger?
Most of the times, "prolonger" is used to express lenghtening something in time, or for an existing line (road, train line, etc).
Suite à ses performances, nous avons décidé de prolonger sa période d'essai.
Grâce aux récents travaux, la route a été prolongée jusqu'à la ville voisine.
I would use "allonger" when I'm talking about something more abstract.
Please note that "allonger" also has other meanings, the main ones being:
- To lay someone down: J'ai allongé la victime par terre pour qu'elle se sente mieux.
- To extend / stretch a body part: J'ai besoin d'allonger le bras pour atteindre cette boîte dans mon placard.
All the meanings are listed in the Larousse definition for "allonger".