This is inappropriate behavior and you need to tell your parents and school officials right away. Teachers should not be touching students. Please tell an authority figure now.
It sounds very possible that your teacher likes you. Hopefully it is in his/her nature to be a overly friendly person. That is usually the case. You should be getting good grades in that class!