Steve and Emilio have provided nice technical descriptions of how a quantum error correcting code is defined. I thought it worth adding where the terminology comes from and how quantum codes and Hamiltonians are connected.
The toric code is called a code because it is a quantum error correcting code.
Quantum error correcting codes are quantum analogues of error correcting codes - used widely in classical computer science to represent information redundantly to protect it from noise and errors. Error correcting codes are used extensively in digital communications technology (e.g. mobile phones) and have a long history (and thus a rich jargon!).
Quantum error correcting codes were developed as an analogue of these to protect quantum information (e.g. qubits) from quantum errors. They share much of the structure of classical codes, and have inherited much of the terminology of that field. The principle difference with a quantum code is that one must consider non-commuting errors (typically Pauli $X$ and Pauli $Z$ errors) and use quantum measurements to detect those errors.
The connection between quantum codes and Hamiltonians - two, at first sight, utterly different concepts - arises because quantum measurement operators are Hermitian, and thus one can construct Hamiltonians out of sets of measurement operators.
In typical quantum codes, the error detection operators are (tensor products of) Pauli operators, with eigenvalues +1 and -1. The +1 outcome is normally interpreted as "no error", whereas the -1 outcome represents an error. If we label our error detection operators $S_k$ where $k$ is an integer index, then error free states are joint +1 eigenstates of $S_k$ for all $k$. In most quantum error correcting codes and, in particular, in the toric code, the operators $S_k$ all commute. Since they are a set of commuting Hermitian operators, we can construct a Hamiltonian
$$H = -\Delta \sum_k S_k$$
where $\Delta$ is a non-negative parameter. The ground states of $H$ are precisely the error-free states of the quantum code. The higher energy states of $H$ correspond to code states with one or more errors.
The toric code can therefore be though of as a quantum error code that encodes and protects two quantum bits of information from quantum errors, but (through the Hamiltonian it defines) also a Hamiltonian model with a rich Physics.