I would be cautious about using it in an essay, not because it's informal but because it may be seen as vague language. The reader may wonder how long is a 'great deal of time', so it might be better to be more precise in your wording.
The first sentence below is better than the second sentence:
1. 'The parliamentary debate lasted almost six months.'
2. 'The parliamentary debate lasted a great deal of time.'