Here's why:
* "In" is used to describe a location or a period of time.
* "On" is used to describe a surface or a specific point in time.
Since seventh grade is a period of time, "in" is the appropriate preposition.
Here are some examples:
* I was in seventh grade when I started playing the guitar.
* My best friend is in seventh grade.
* She will be in seventh grade next year.