Here, the state of our knowledge regarding the interior dynamics and evolution of habitable terrestrial planets including Earth and super-Earths is reviewed, and illustrated using state-of-the-art numerical models. Convection of the rocky mantle is the key process that drives the evolution of the interior: it causes plate tectonics, controls heat loss from the metallic core (which generates the magnetic field) and drives long-term volatile cycling between the atmosphere/ocean and interior. Geoscientists have been studying the dynamics and evolution of Earth's interior since the discovery of plate tectonics in the late 1960s and on many topics our understanding is very good, yet many first-order questions remain. It is commonly thought that plate tectonics is necessary for planetary habitability because of its role in long-term volatile cycles that regulate the surface environment. Plate tectonics is the surface manifestation of convection in the 2900-km deep rocky mantle, yet exactly how plate tectonics arises is still quite uncertain; other terrestrial planets like Venus and Mars instead have a stagnant lithosphere- essentially a single plate covering the entire planet. Nevertheless, simple scalings as well as more complex models indicate that plate tectonics should be easier on larger planets (super-Earths), other things being equal. The dynamics of terrestrial planets, both their surface tectonics and deep mantle dynamics, change over billions of years as a planet cools. Partial melting is a key process influencing solid planet evolution. Due to the very high pressure inside super-Earths' mantles the viscosity would normally be expected to be very high, as is also indicated by our density function theory (DFT) calculations. Feedback between internal heating, temperature and viscosity leads to a superadiabatic temperature profile and self-regulation of the mantle viscosity such that sluggish convection still occurs.