There is a lot to say about wifi on Cuba. First, you can access the Internet via the 3G-network, but it is expensive.
Wifi is only allowed in hotels and on hotspots in the major cities. In these wifi-hotspots you will find a lot of people with the mobile phones. To access the Internet costs approximately $2 per hour, which is a lot of money fpr the average cuban.
To be able to use wifi you need to buy a card from ESTCA, the Cuban Telephone Company. You can buy these cards in most hotels and in the ESTCA offices. Be prepared to show your passport. In some (but, not all) ESTCA offices they require you to show your passport.
Then you need to find a wifi hotspot.
Here is a Map to wifi-hotspots on Cuba.
Keep in mind that many hotels also offer wifi, even if you do not stay in the hotel, and they sell the ESTAC-cards. There are also some Internet cafés.
The wifi map