If you don't transfer files at the time you delete a user, the user's files are deleted 20 days later. If you act quickly, you can restore the deleted user and transfer ownership of their files before they're permanently deleted.
If the user isn't deleted, learn how to Recover deleted files and folders for Drive users.
Restore Drive files from a deleted user
You have up to 20 days after a user is deleted to restore their account and data.
Once the user is restored, transfer ownership of their files to an active user.
Delete the user account of the original file owner.
Automatically keep shared files when someone leaves
If you use shared drives for shared files, the files are owned by the entire team. You don't need to worry about losing these files when someone leaves the organization.
Shared drives are available with these editions.