Several personality traits are mainly expressed in a social context, and others, which are not restricted to a social context, can be affected by the social interactions with conspecifics. In this paper, we focus on the recently proposed hypothesis that social niche specialization (i.e. individuals in a population occupy different social roles) can explain the maintenance of individual differences in personality. We first present ecological and social niche specialization hypotheses. In particular, we show how niche specialization can be quantified and highlight the link between personality differences and social niche specialization. We then review some ecological factors (e.g. competition and environmental heterogeneity) and the social mechanisms (e.g. frequency-dependent, state-dependent and social awareness) that may be associated with the evolution of social niche specialization and personality differences. Finally, we present a conceptual model and methods to quantify the contribution of ecological factors and social mechanisms to the dynamics between personality and social roles. In doing so, we suggest a series of research objectives to help empirical advances in this research area. Throughout this paper, we highlight empirical studies of social niche specialization in mammals, where available.