To dream that you are congratulating someone represents your ability to offer your help and assistance to others.
To dream that you are being congratulated indicates that you need to learn to ask for help when you need it.
You need to let go of your pride. Alternatively, the dream represents approval of your action or decision.
If the teacher congratulates you it means you trust yourself and your abilities.