Various definitions of the symmetry energy are introduced for nuclei, dilute nuclear matter below saturation density and stellar matter, which is found in compact stars or core-collapse supernovae. The resulting differences are exemplified by calculations in a theoretical approach based on a generalized relativistic density functional for dense matter. It contains nucleonic clusters as explicit degrees of freedom with medium dependent properties that are derived for light clusters from a quantum statistical approach. With such a model the dissolution of clusters at high densities can be described. The effects of the liquid-gas phase transition in nuclear matter and of cluster formation in stellar matter on the density dependence of the symmetry energy are studied for different temperatures. It is observed that correlations and the formation of inhomogeneous matter at low densities and temperatures causes an increase of the symmetry energy as compared to calculations assuming a uniform uncorrelated spatial distribution of constituent baryons and leptons.