He was abducted by Hagrid when he turned 11 so that would place him maybe around the fifth or sixth grade.
I don’t know if canonically there are math classes at Hogwarts.
The thought came to while I was watching the anime Mashle. If you are into Harry Potter and One-Punch Man I’d recommend giving it a watch.
Someone mentioned this community below; I wanted to highlight it.
Small promotion for !harrypotter@literature.cafe
It’s just like an izekai but for English reading children.
Isekai is nothing new. Peter Pan, Alice in Wonderland, and The Lion, the Witch and the Wardrobe are all “isekai”. JK is just a special kind of bad writer.