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 a function of both the film thickness and the momentum in the plane of the film for ${\mathrm{Bi}}_{2}{\mathrm{Se}}_{3}$ and ${\mathrm{Bi}}_{2}{\mathrm{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 nontopological 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 ${\mathrm{Bi}}_{2}{\mathrm{Se}}_{3}$, making ${\mathrm{Bi}}_{2}{\mathrm{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.