Basically, I give you a Hamiltonian, perhaps I give you a symmetry you must respect, and I tell you that the gap must not close. You are free to deform my Hamiltonian all you want, but you must respect the two conditions of symmetry and finite gap.
Topological insulators may be characterized by saying that there are two (or more) different gapped states associated to two different Hamiltonians which can never be deformed into each other without either breaking the symmetry or closing the gap. Note that symmetry is not always required.
As an example of a topological insulator called a Chern insulator, consider a two band model in two dimensions. Neglecting uniform onsite energies, a general Hamiltonian may be written in terms of a vector [itex]d^a(k)[/itex] where k sits in the Brillouin zone, a two dimensional torus. In momentum space the Hamiltonian is [itex]H(k) = d^a(k) \sigma^a[/itex]. The requirement that the gap remain finite is simply the requirement that [itex]|| d || > 0[/itex]. [itex]d^a[/itex] lives in three dimension, but the point at the origin is removed. Three dimensional space with a point removed is topologically equivalent to a two dimensional sphere. In the Hamiltonian language, you get the sphere by replacing [itex]d[/itex] with [itex]\hat{d} = d^a/||d||[/itex] i.e. by normalizing it. This doesn't change any of eigenvectors, it only deforms the energies, and it is always possible if [itex]||d|| > 0[/itex].
Now the punchline is that [itex]\hat{d}(k)[/itex] defines a map from the two dimensional torus (k space) to the two dimensional sphere (space where [itex]\hat{d}[/itex] lives). Deforming the Hamiltonian is deforming this map, but such maps are labelled by a topological integer called the winding number, and this number does not change under smooth deformations. This number is called the Chern number and physically it gives the Hall conductivity, but the point here is that it also labels different inequivalent gapped Hamiltonians. If you're just beginning, it is essential to play with these maps a bit e.g. try constructing one.
Topology enters in many other places and with many elaborations. However, I hope that this helps make contact between the two fundamental ideas you mentioned: deformation of Hamiltonians and topological invariance e.g. donut = coffee cup.