Is it appropriate to write in an essay A bunch of people or A bunch of friends?
If your audience/teacher/professor says no, that is the answer.
In theory, if someone says, "A bunch", the reader might want to know "how many?"
Likely, you were corrected as per "a bunch of carrots" vs "a group of people". Colloquially, you'd probably say a bunch of people came through the train station (indicating a great multiple of individuals over a period of time) vs a group of people met for coffee (indicating a simultaneous gathering of individuals). Especially, any formal gathering of people is considered a group. Meanwhile, a large aggregate (countable) number of individuals could be a "bunch" but more appropriately, one might be asked to clarify the number of the individuals if a "bunch" were specified.
Why would it be not acceptable to use bunch of people in an essay? Probably for the same reason that one should use the term murder of crows or herd of cattle. A group would be the more proper term for the gathering of humans.
For reference, check out a non-authoritative list of animal group names.
The comment from OP in my other answer:
Again, i would appreciate if you would explain the difference if it were spoken. Would it be appropriate for me to use I have a bunch of friends supporting me on this project.?
If it were spoken, it probably won't matter whether one uses bunch or group. For written, graded, or recorded purposes, for posterity reasons, one will want to attempt to use more formal language, especially when requested.