Is it appropriate to give a gift to a teaching assistant for helping outside of work time?
I would consider that, in many cases, helping students "outside of work time" is often still under the normal job description of a teaching assistant. However, since you are asking the question, I am going to assume that your TA went above and beyond their normal calling. Even in that case, a gift might make someone uncomfortable, and should certainly never be given before grades are final.
Other options that might achieve what you want without making anyone uncomfortable and that might have greater impact with no more effort from you than a gift could include:
Nomination for a teaching award. Many institutions have some formal mechanism for recognizing great teaching assistants; even a nomination could be something that TA could use in the future on a job application.
Letting the professor know how helpful your TA was. Professors don't see all aspects of their TA's work. Knowing that a particular TA was helpful to the students might help that TA get a future position, or is material that can be included a letter of recommendation. You could also ask the professor if there is anyone else in the department where you can send compliments for a particular TA.
There is also nothing wrong with thanking your TA directly and making it clear their time was appreciated - no need to go overboard, just a simple email is sufficient.
I would suggest writing them a note or card letting them know how much you appreciated their help; a couple of have students have done this for me in the past, and I've been really tickled by it. It scratches the same itch as a gift, but doesn't require figuring out what they would like. I wouldn't have minded getting chocolate instead, but it would have felt a little stranger.
To expand on something Bryan Krause said above: even if there's no obvious mechanism to nominate them for an award, you can tell them if they need a letter from a student in the future (these are standard for teaching awards and tenure applications, though oddly not job applications), you would be happy to write one. That both expresses your appreciation and could be useful to them.
Do beware of regulations at your particular University - At my institution it is forbidden as a TA to receive gifts or payment for TA work from students.
I think it is designed to stop us using our TA positions to make extra money from students for additional tuition but it covers literally anything. I had a student keep offering to buy myself and a colleague for helping him outside lab hours - took a lot of explaining that we would help but couldn't accept any form of payment.