Go to Power Platform admin center, select an environment.

Power platform admin center

Power platform admin center Environments

On the command bar, select Settings > Integration > Teams integration settings.

Environment Dev Settings

Teams collaboration & chat

On the Microsoft Teams collaboration and chat page, turn on Sync Teams chat data with Dynamics 365 records.

Dynamic 365

Save the changes.

Thanks.!!