In Shotgun, you can assign people to Groups and Departments on the People page.
Groups are used for addressing or assigning. You can create groups of users, and then either assign a Group to a Task, or you can address Notes and Tickets (and other threaded entities) to a Group. The users in the group will then get a notification when the Note is created. One user can be in many Groups.
Departments was introduced with the Crew Planning app, and is a way to define users according to expertise (at least in the Crew Planning context). For example, you can create a filter to only show users in a particular department. No notifications are sent based on a user's departments, and a user can only be in one department.
When to use Groups and Departments
Studios often create more groups than departments. You might create a group for a specific project, or even a particular scene. That way, you can easily notify a wide range of people tasked on the same work. Departments tend to be used more broadly to define users. For example, in a 100 person studio, you might want to know how many people are in the animation department.