When you share a folder or a file in Google Drive with anyone, the shared links will stay active forever until you manually change the access permissions. Tech blog Digital Inspiration shows how you can add an automatic expiration date to folder with a simple Google Script.
You can add an auto-expire feature to any of your shared folders in Google Drive with the help of a simple Google Script. To set up expiration dates, you need to make a copy of a Google Script, add the URL of your Google Drive folder, and then set the expiration date. Run the script and your folder’s sharing privileges will automatically expire at the specified time.
Learn step by step how to put Expiry Dates for shared Folders