Set your out of office notification directly from Teams
Select your profile picture, and then status message > Schedule out of office.
Or go to Settings > General > Out of Office and select Schedule. Just as you would in Outlook, you can personalize your automatic reply and choose how long it's set.