Go to Admin > Team > Groups > Edit > Group properties > Check the option 'Allow agents to change their availability for automatic ticket assignment'. 

Note: If the Auto assignment has been enabled in multiple groups and even if in one of the groups the above-mentioned option is not checked, the agent will not have permission to change the availability.