Sudden cardiac death (SCD) is a challenging health problem in the western world. Analysis of cardiac repolarization from the electrocardiogram (ECG) provides valuable information for stratifying patients according to their risk of suffering from arrhythmic events that could end in SCD, as well as for assessing efficacy of antiarrhythmic therapies. In this paper, we start by exploring the cellular basis of ECG repolarization waveforms under both normal and pathological conditions. We then describe basic preprocessing steps that need to be accomplished on the ECG signal before extracting repolarization indices. A comprehensive review of techniques aimed to characterize spatial or temporal repolarization dispersion is provided, together with a summary of their usefulness for clinical risk stratification. Techniques that describe spatial dispersion of repolarization are based on either differences in repolarization duration or T-wave loop morphology. Techniques that evaluate temporal dispersion of repolarization include the analysis of QT interval adaptation to heart rate changes, QT interval and T-wave variability, and T-wave alternans.