Several studies have documented the importance of social bonding for the enhancement of individual fitness. However, little is known about how social relationships develop through ontogeny, and whether their development follows the same trajectory in males and females. Here we analyzed affiliative interactions (proximity, social grooming, play) combined with demographic and genetic data in semi-free-ranging rhesus macaques (Macaca mulatta) on Cayo Santiago over their first 4 yr of life (from birth to sexual maturation) to understand how these interactions change through development in both sexes. Generalized linear mixed models revealed that social behaviors mostly followed different developmental trajectories in males and females and were highly dependent on the social context. In particular, sex differences in social behavior varied through development depending on the partner’s sex and age. Females engaged in more social interactions than males, especially with other females, and were more involved in grooming around the time of maturation. In contrast, males interacted more with males and age peers, especially around maturation. Sex differences in social behavior varied through development, but also depended on rank, partner’s rank, and kin line, although not consistently. High-ranking individuals, especially older females, were generally preferred as social partners. Moreover, both male and female individuals interacted mostly with maternal kin, although males also preferred paternal kin over nonkin. Importantly, most developmental changes in sociality happened when individuals were ca. 2 yr old, suggesting that this might be a milestone in the development of sociality in rhesus macaques. The only notable exception to this pattern was play, which was more pronounced in males from the beginning of their lives. We propose that play might serve as a trigger of sex differences in social behavior, with sex differences emerging early in development and increasing through time as males and females gradually grow into their adult social roles.