Most likely Spain can hold Cuba as long as it can avoid a civil war, or a disorderly change of government. Militarily, there is no reason the Spanish cannot hold the island, but disorder in Spain would make it more likely that the US would intervene, or that rebels would be able to gain enough ground to be recognized by an interested foreign government, such as the United States.
Given those conditions, I can see the Spanish holding onto the island until the 1930's. Spain is unlikely to leave that decade without some kind of serious domestic strife. This would allow the island the opportunity to declare independence. Alternatively, a hard left government of Spain aligned with the Soviet Union would almost certainly cause the US to intervene in support any credible independence movement, even if it was based in New York or Miami.