By default, if there is no activity detected for five minutes, Teams will change the status to away. However, this duration can be customized in the Teams settings.