I have assigned the Business Central Essentials license to this user:
I want to assign it to the user "Administració LaBarca" but when I change the license to that user, my companies are not available anymore. So I think companies are linked to the user/license that created it the first time.
How can I transfer the Business Central Essentials license to another user without loosing my companies?

When you assign a license to a user that user must be imported to Business Central in order to gain access.
Default permissions will be applied to the user during import and these permissions might be company specific meaning that user will on be able to access the company it has permissions to.
If you only have one license, then you need to move it to the new user and then have and Admin user log onto Business Central an import the user.
Companies are not linked to specific users, they are linked to environments which are linked to an Azure tenant.