See explanation below.
Explanation
Set group expiration
1. Open the Azure AD admin center with an account that is a global administrator in your Azure AD organization.
2. Select Groups, then select Expiration to open the expiration settings.

3. On the Expiration page, you can:
Set the group lifetime in days. You could select one of the preset values, or a custom value (should be
31 days or more).
Specify an email address where the renewal and expiration notifications should be sent when a group has no owner.
Select which Office 365 groups expire. You can set expiration for:
All Office 365 groups
A list of Selected Office 365 groups
None to restrict expiration for all groups
Save your settings when you're done by selecting Save.
Reference:
https://docs.microsoft.com/en-us/azure/active-directory/users-groups-roles/groups-lifecycle