It depends on how often you see the teacher and how "close" you are with them. I'm in high school, so I'm pretty "close" with my teachers, and I usually just close with "Thank you/Thanks", [name].
I'm not sure about college or online school, but I'd probably write more formally.
Hope this helps!
- For Teachers