Schools in the late 19th century US are often depicted as being single room with one teacher for everybody. Was this the case and, if so, how did they teach things to the different age groups? Would first graders be working on different things while eighth grade material was being taught?
The image the media presents of 19th century American schools as a one-room building with children from all ages takes a few liberties with regards to timing and location and typically take a fair amount of dramatic license. A few things to note.
First, "US schools" are a bit of a misnomer as education isn't mentioned in the US Constitution so each state determines the look and nature of education within its borders. The system of public schools in Mississippi, for example, has a very different history than Massachusetts. Meanwhile, the difference between urban and rural schools was, to put it mildly, dramatic. Schools in New York City were very different than those in the middle of the state. There are even some communities in the state who still operate their original one-room schoolhouses.
Second, there was no real social pressure to speak of in the 1800s for children to go to school. It wouldn't be until the 1960s and the widespread use of the phrase "high school dropout" to mark the social shift that America expected children to be in school from the ages of 5 or 6 to 17 or 18. Before that point, especially during the era you're asking about, children went to school if/when their families thought it made sense and kept them home when it didn’t. School systems need bureaucracy to operate - to disperse tax dollars, transport children, manage attendance, etc. and they wouldn't be operational in any meaningful sense in the larger cities until the 1910s, at the earliest. The school “year” was actually generally, two or three sessions a year, lasting for 6-8 weeks, 4 to 5 hours a day. Meanwhile, the notion of grade levels was associated with large, urban districts more so than smaller rural schools.
Third, teachers were were mostly young, unmarried women who were deep in a battle for their professional identity. They were barred from speaking at national educational conferences, routinely kept from advancing out of the classroom, and could be fired on a whim. (The history is, of course, more complicated in large urban areas, especially Chicago and New York City.) Teaching was hard work and, in many cases, a young woman from the East Coast graduated from 8th grade and headed west to lead her own school. While this was form of Protestant missionary work, the general sentiment was that an educated population was a net good for America. (The history is, of course, different for free and formerly enslaved Black and African Americans, Indigenous, Hispanic, and Mexican children.)
These three mini-histories can help contextualize school in the 1800s as a very idiosyncratic place that could follow dozens of different structures or approaches to pedagogy. Towns or villages typically had only one building to educate the town’s children. In some places, the design of the school looked remarkably similar to a church, in others, it was a building that started as a home but expanded and turned into a school building when the resident moved out, or moved out to make space for the school. What happened inside that school was highly dependent on a whole bunch of factors: the teacher’s training, the school’s location in the country, the level of control the state or county had over the schools, and what particular educational philosophy was dominate at the time. In effect, the teacher may have organized lessons for the older children to read to younger children while she taught the youngest. She may have used a recitation method where she read a sentence or word and asked children to repeat it back. She may have tasked misbehaving/or well-behaved children with cleaning and maintaining the school while she taught those who were well-behaved/misbehaved.
Note that an older child who had been in the same community for 8 years, attending the same school, may have thought of themselves as an 8th grader, ready to graduate but that would likely depend on the community and the teacher. A first-year student could have been anywhere from four to eight years old and would leave after 8 or so years or when their family felt they were done. It was more common for a student to “finish” school than to “graduate”, especially in communities without high schools.
Finally, school in the late 1800s were different terms of philosophy, pedagogy, and population than the 1870's, which were different than those that existed before the Civil War. It's safe to say that what happened inside one particular one-room schoolhouse could look very different than the one-room schoolhouse the next village over.