When an Exchange Online license is removed from a user, Exchange Online data associated with that account is held for 30 days. After the 30-day grace period, the data is deleted and can't be recovered. If you add the license back to the user during the grace period, this will restore access, and the mailbox will become fully active. And if you add the license after the grace period, it will create a new mailbox for the user.
Delete or restore user mailboxes in Exchange Online | Microsoft Learn