"Grade" is used for elementary, middle, and high schools.
For high school, you can alternatively say that someone is a freshman (9th grade), sophomore (10th grade), junior (11th grade), or senior (12th grade), or you can say that they are "in their freshman year", "in their sophomore year", etc.
And then it gets confusing because these also cross over to someone's undergraduate studies in college (someone in their first year of college/university is also a "freshman", et al).
Mostly just context. The same way you can tell the difference when вопрос means "issue" and when it means "question", or when политика is referring to politics in general or a specific policy.
Some examples for when it means marks:
What grade did you get in math?
What grade did you get on the test? (Often times Americans will drop 'grade' in this context and just say "What did you get on the test?")
What kind of grades did you get in high school?
Johnny always gets good grades in school.
Some examples for when it's referring to form:
He failed ninth grade. ('Grade' when it refers to form is peculiar. To my American ears it sounds equally acceptable to use an article here--"He failed the ninth grade." Don't ask me why.)
What grade are you in?
High school is usually comprised of grades nine through twelve.
Study hard, you don't want to have to repeat a grade.
Johnny seems to be be much smarter than the rest of the kids in his grade.
Russian Lessons | Russian Tests and Quizzes | Russian Vocabulary |