We prove that the cohomological dimension of the Torelli group for a closed connected orientable surface of genus g at least 2 is equal to 3g-5. This answers a question of Mess, who proved the lower bound and settled the case of g=2. We also find the cohomological dimension of the Johnson kernel (the subgroup of the Torelli group generated by Dehn twists about separating curves) to be 2g-3. For g at least 2, we prove that the top dimensional homology of the Torelli group is infinitely generated. Finally, we give a new proof of the theorem of Mess that gives a precise description of the Torelli group in genus 2. The main tool is a new contractible complex, called the complex of cycles, on which the Torelli group acts.