In theory, either could be used in the right context. However, more natural would be:
My class ends at 2 PM.
Ju, this is the third of your threads that I have moved from "Teaching English" to "Ask a Teacher". Please remember that the "Teaching English" section is for teachers and trainee teachers to ask other teachers for help with actual teaching.
I think you're misreading the name of the section when you choose it. I have moved this thread, the one called "Dedicated" and the one called "Does the school have assembly today?" from the "Teaching English" section.
If you have a question about the English language and would like to ask one of our many English teachers and language experts, please click the button below to let us know: