One in 6 (after DEs invade with Draco's help to kill Dumbledore) and an end-all war in 7.
For technical terms, which I think is what confused you, the battle in 6 is properly called the Battle of the Astronomy Tower, though it takes place throughout Hogwarts (especially when they're fleeing). The one in 7 is the Battle of Hogwarts.