Psychology is related to sociology and both the branches of knowledge belong to one discipline called social science.
Sociology studies the laws that govern the development and functioning of different kinds of groups like political, social, economic, and religious. It emphasizes the observable characteristics of group structure and group functions. Psychology studies the activities of the individual and a group is formed by several individuals.
Sociology studies the group behaviour, and its influence on individual behaviour. Knowledge of individual behaviour helps to understand the group behaviour and the knowledge of group behaviour helps to analyze and interpret the individual behaviour. Psychology studies the behaviour of the individual and sociology studies the role of individual in group activities, and group structure. So sociology and psychology are closely related.