Effort for a User Story or any other assignable entity (Task, Bug, Request, Test Plan Run) is calculated as sum of Role Effort values for the given entity. Additionally, for a user story, sum of effort of its tasks is also included into total effort.
High-level scopes of work such as features, epics, projects, releases and iterations do not have their own effort. Instead, you can assign work items to them. Their effort becomes equal to total amount of effort of all assigned entities.