I usually started getting references about 4 weeks before the essay would be due and then use those references to understand/plan. Then write the actual paper in about 1-2 days. Then cut it down for about 6 hours. Then referencing would take me about 1.5 to 2 hours because I would use about 45-50 references per paper.
But it depends on what exactly it involves! And also not everyone will be able to write their paper in 1-2 days some will spend less time on reference searching/planning and more time actually planning as you write etc. Just works for me to get everything down on paper in one sitting and then tweak it most of the time.
That said, for my last research paper, I found references over 6 days and wrote it overnight all-nighter style, then went to a Genetics exam.