You can mount all the electrical in anything you want, screw it all to a wall if you wish. I prefer to have it housed to prevent water from getting on it as much as possible AND to prevent electrical shock.
I was hit once fooling around with my punkin controler over summer. It'll really get the old heart a beating.

This is what I will be using for a housing as most people should be able to find something similar fairly easy .
Mom dropped me off some grub in it but she ain't gettin it back.
Sorry Mom! and Thank you!

What have done here is trace out holes to be cut so that the timer and AC outlets will fit in there nice and snug.
The AC outlets have small retaining clips on them so if you cut it right they will snap right into place. You can cut the holes out using a utility knife or whatever you have handy. A Heated utility knife works well or you can use a spade bit and trim the corners out. For the timer a hole saw works excellent, I believe it is a 2.25 inch hole saw but don't quote me on that .

Cut out the openings for your Timer, outlets and cords.
In this pic there is only one hole for the cord but we will be needing three, one for the power supply cord and one for each set of switch wires.

I used a 2.25 inch hole saw for the timer hole, which is the perfect size. I used a 13/16ths of an inch spade bit for the switch holes and then a hack saw blade to cut the corners out, then a file to clean it up for a nice fit.
A drill bit for the power supply and switch holes.

A Tip: drill holes from teh inside against a flat surface to avoid cracking the plastic of the container, "like I did".