New Zealand English.
A class is either a physical/virtual location or [a group of students/1-student + teacher] or a setting in which a lesson is delivered.
A lesson is a service delivered by a teacher that transfers information from teacher to student.
A period is a fixed regular/repeating unit of time when a class/lesson [takes place]/happens.
But,. they can all be used to mean go to class. go to a lesson, go to this period, meaning attend a teaching session.
The next class is physics.
Next period is physics.
Next lesson is physics.