Where can I put helper functions for my theme?
Helper functions is a bit vague for a description (so there may be better places where to put this, like a custom module), but theme functions are usually put into the template.php file of your theme.

It is not generally adviced to put much php code into your templates however (save for printing variables) - best practice usually calls for the use of alter hooks or other preprocess functions. Get a (small) overview here: template.php