Meaning: This sentence describes the conclusion of a class session with students bidding farewell to each other and the teacher.
Choice of Words: The sentence uses past tense to describe a completed action. The subject is "class", "ended" is the past tense of "end", "with students saying goodbye" describes the manner in which the class ended.