An isolated many-body quantum system is characterized by the absence of any coupling to its environment. According to the laws of quantum mechanics its time evolution is unitary. In spite of this, macroscopic systems are expected to eventually ``relax'' in some way and be amenable to a description by quantum statistical mechanics. Especially in one dimensional systems, the nonequilibrum states often exhibit exotic features. \par In these lectures we will consider some aspects of nonequilibrium time evolution in spin chains. We will mainly focus on integrable systems. More than half of the course will be devoted to the study of the so-called quench dynamics in homogeneous systems; the rest of the course will be on the effects of inhomogeneities, culminating in the description of the so-called generalized hydrodynamic theory. Whenever possible, underlying physical phenomena will be described and explicitly calculated for noninteracting spin chains. Interacting integrable systems will be investigated more qualitatively, pointing out the main effects of the interactions. \par Plan of the lectures: \\ 1) Overview of quench dynamics: meaning of relaxation, integrable vs generic systems. \\ 2) Determination of the local conservation laws in noninteracting spin chain systems and brief overview of the interacting integrable case. \\ 3) Time evolution of the entanglement entropy and relation to the thermodynamic entropy. \\ 4) Overview of the phenomenon of pre-thermalization in the presence of weak integrability-breaking perturbations, and exact study of the intermediate time dynamics in a toy model displaying pre-relaxation. \\ 5) Time evolution in inhomogeneous systems; generalized hydrodynamics.