  We study the properties of a thin film of topological insulator material. We
treat the coupling between helical states at opposite surfaces of the film in
the properly-adapted tunneling approximation, and show that the tunneling
matrix element oscillates as function of both the film thickness and the
momentum in the plane of the film for Bi$_2$Se$_3$ and Bi$_2$Te$_3$. As a
result, while the magnitude of the matrix element at the center of the surface
Brillouin Zone gives the gap in the energy spectrum, the sign of the matrix
element uniquely determines the topological properties of the film, as
demonstrated by explicitly computing the pseudospin textures and the Chern
number. We find a sequence of transitions between topological and
non-topological phases, separated by semimetallic states, as the film thickness
varies. In the topological phase the edge states of the film always exist but
only carry a spin current if the edge potentials break particle-hole symmetry.
The edge states decay very slowly away from the boundary in Bi$_2$Se$_3$,
making Bi$_{2}$Te$_{3}$, where this scale is shorter, a more promising
candidate for the observation of these states. Our results hold for
free-standing films as well as heterostructures with large-gap insulators.
