Here's why:
* The Battle of Hogwarts: The book focuses heavily on the final battle and the events surrounding it. There wouldn't be a traditional school year or elections happening during this time.
* The End of Hogwarts: By the end of the series, Hogwarts has been severely damaged and ultimately closes. The Head Boy and Girl positions would be rendered irrelevant.
However, we do know that Percy Weasley was a Head Boy in his time at Hogwarts. He was a Gryffindor, just like Harry.
Let me know if you have any other Harry Potter questions!