In the Harry Potter series, a prefect is a student who has been given extra authority and responsibilities by the Head of House or Headmaster. One male and one female student from each house are chosen for the role of prefect in their fifth year. The responsibilities of a prefect include patrolling the Hogwarts Express, taking and awarding house points, and dishing out detentions. Prefects also have some special privileges, such as their own bathroom and the power to take points away from other houses. They are under the jurisdiction of the Head Boy and Girl.
Although the movies hardly make mention of prefects, the Harry Potter books have referenced them throughout, with notable characters like Tom Riddle (Voldemort), Hufflepuffs Cedric Diggory, and a few of the Weasley siblings having been prefects in their designated dormitories. Being a prefect is also a real student representative role in the United Kingdom, given to those who have shown responsibility and initiative during their time in school and are willing to continue to do so in a more official capacity.