I wouldn't say either of them. I think using 'must' like that would rub people up the wrong way in the UK. As Judd explained 'must' is something you absolutely must do, it is an order and sounds quite authoritative.
It's grammatically correct to say 'you must listen to your teacher' or 'you must listen during the lesson' but there are better ways to express this idea in my view. It's a matter of tone. I would probably say something like 'when the teacher is speaking, you should pay attention to what they are saying.'