Shared mailboxes do not need a separate license as such. But every user who is a part of the shared mailbox must have a G Suite license.