To enter Cuba as a tourist you are required to purchase a tourist card (Tarjeta de Visado). This is a fill-it-out-yourself card which you present to the Cuban immigration officer.
This costs approximately US$ 25.
You are required to enter the hotel or private house (casa particular) where you will be staying on the tourist card. Generally there is no requirement to show an actual paid-for reservation although some consulates require a reservation.
The tourist card is valid for 30 days (except for Canadians who have 90 days) and may be extended for a further 30 days (90 if you are Canadian). To renew the tourist card you need to go to an immigration office with CUC 25 worth of stamps (buy at a Banco Metropolitano) and your documents. This is a straightforward process but can take time, especially in Havana, due to long queues. (Addresses of Immigration offices).
In Canada, Mexico, Bahamas and Panama you can generally simply buy a tourist card at the airport desk or through your travel agenTel.
In Europe in general you cannot purchase a tourist card at the airport and will be refused boarding of the plane without a valid card which can be bought either in person from the Embassy / consulate (List of Cuban Consulates Overseas) or through certain agencies / travel agents (Visacuba:
https://www.visacuba.co.uk/secured/index1.aspx
If you are visiting Cuba on business or as a journalist you should apply for the relevant business / journalistic visa from the relevant Cuban consulate at least 3 weeks in advance.
If you are staying with friends of family in a non-licensed place you should apply for a family visa from the Cuban consulate.