You can now set a duration when setting up your availability status.
This option is available for both the ‘classic’ and ‘new’ Teams clients on Windows or web browser; this is not available in Teams mobile.
To set the duration, select the Duration option available when clicking on your picture, select the availability status and then the duration