Is it ethical to accept small gifts from students? And how small is small?
In the general case, professors/lecturers/TAs should not accept gifts from students, as these things can lend themselves very easily to accusations of conflict of interest. This falls in the same general category as dating one of your students, or grading your kid's exam.
That said, I can think of three situation where gifts are acceptable.
(1) a graduating student gets you something nice after graduation (e.g., in the department where I did my PhD, it is normal for students and advisors to exchange gifts after a successful doctoral defense).
(2) a current student makes a "collective gift", e.g., a student brings a cake to class to celebrate his/her birthday and offers you a slice.
(3) you go through some major life event and students pitch in to get you something, e.g., when I came back to work after having to get major surgery, the grad students in my department got me a nice coffee machine to celebrate that I hadn't died.
I will disagree slightly with some of the previous answers. I come from a health-care perspective. A great deal of papers discuss the ethical/moral ramifications of accepting gifts from patients and subordinates and students/trainees. I will say up-front that I believe accepting valuable gifts from students is a problem and should be avoided in the vast majority of circumstances. In contrast, I do not ALWAYS see a problem with accepting small gifts from students/patients. Offering a gift is typically a way to express some appreciation and accepting the gift is a way to express your appreciation of the appreciation. Rejecting the gift can be slightly insulting and harm student-teacher rapport. Coming off in a stand-offish way to one student can have long-lasting implications.
I had two experiences where a student offered me a small basket of cookies and another offered a decoration with a value of 10$. I kindly told them no thank you, but they insisted. I insisted no thank you again, and they re-insisted. I know if I said no once again, she would have been insulted. It alienates the student and puts me in an awkward position of being an authoritarian person who cannot participate in typical activities (i.e., doing/accepting small favours). A teacher is not a friend, and that should be clear, but a teacher can still be warm, and approachable.
In essence, the benefits of accepting a gift (e.g., increasing approachability, seeming nice/human) can often outweigh the potential costs (which are often negligible if the gift is of nominal value). This is, of course, on a case by case basis. It might be appropriate in some contexts (e.g., very small class, clinical supervision) but not others (e.g., very large class). As is often the case, judgment is needed.
I have students bringing me gifts quite often. Like Stephan Kolassa, I am quite uncomfortable with it. I am made even more uncomfortable by the fact that in the local culture (not my native culture) it is common for subordinates to bring gifts to their boss, which seems to me like a continued corruption to keep ones job.
As should be obvious to anyone in a position in power, people subject to that power think it is great to be able to buy preferential treatment. Some of my students get chauffered to school in very expensive cars (>$100,000) so I am sure they have the money to give as expensive of a gift as they feel.
However, as the one in power, I must keep this tendency in check. I, therefore, simply do not accept gifts from individual students. Period. I do, however, accept gifts if they are from the entire class and presented by the "leader of the class" which all classes here have.
There are limits on what I would accept from the class but that has never been in question. The biggest gift I've received would set each student back $1. And to be clear, I would never accept cash or something very similar to cash.