Cuba is still a developing country in terms of Internet access. For a few years tinternet was only available via satellite, and that was slow. There are now a few submarine cables, which has improved the speed, reliability and accessibility. Internet access in Cuba is basically offered by the state provider ETECSA. The internet available in hotels is just passed through to the provider as well.
There are WiFi hotspots at various public places in the country, especially in the larger cities. You can buy an access code that can be used by the hour. The hour of internet access costs the equivalent of around 2 euros, which is a lot for Cuban standards. You can log out and "stretch" the hour. But you have to keep the login page open so that you can press the "Logout" button. If there are intermittent disconnections or failures, the hour just continues, cannot be interrupted and ultimately expires. Access codes are sold in hotels, for example.
The access code can only be used on one device, simultaneous use on several devices is not possible. If this is the intention, it is advisable to get a WiFi extender in advance and log in to the WiFi via this extender.
The country does not have a working 4G network for mobile communications, but a 3G network is provided in several places. Again, especially in the larger cities. There are plans for a 5G network, but they are not very advanced as of now.
Access to the mobile network via roaming is ... expensive. It is best to compare the prices at home with your own provider. As a rule, Cuba falls into the most expensive "world" category. Prices of 30 € per 10MB of data are not uncommon.
You can buy or rent a SIM card in the country. This makes sense if you are dependent on mobile internet and do not want to be limited to the WiFi hotspots. The SIM cards can be purchased in post branches, knowledge of the Spanish language is needed, and employees generally do not speak English.
The WLAN in hotels is relatively well developed, but the hotels only offer the access point. Again an access code has to be purchased - see above.
Some American companies are blocking access from Cuba. Social media websites work, but I was unable to upload my Garmin watch data. Fortunately, my devices have configured a VPN that bypasses this problem.