What volume should I listen to music with headphones in class and so no one hears ANYTHING from inside my headphones?

I use iPhone 7 but I don't think that matters.

It depends on the headphones, but what I usually do is a play a loud song and take my headphones out to see if you can hear the music through them. When I can, I know I need to go one volume increment lower.

Zero.

You should not be listening to music in class.