Make sure the gift is inexpensive. While this is not usually a problem, a teacher will feel very awkward accepting anything expensive. It may even be illegal or at least unethical for them to take such gifts. Check with the school first.
Do not give a gift of food. As a teacher, I would receive homemade cookies or cupcakes or candies as a gift. I always took them, thanked the student, and then after school I would take them home and throw them away. I hated to do this, and I hate to admit to this, but I wouldn't trust eating the items. Perhaps I was neurotic, but I just never knew if the items were safe or not. I always felt bad about his and would have preferred the students just not give food items as gifts.
I believe the best gift for any student to give his or her teacher is just a simple "Thank You" card. It can be store-bought or hand-made, but it will convey your thoughts better than any other item. They're safe and teachers love them, especially for their scrapbooks.