My answer is that there was no such umbrella term in common use in the 1800s that corresponds directly to our "Hispanic" or "Latino" category. I think T.E.D.’s answer is correct in that people with Mexican origins were called Mexicans. And if you lived in an area where most people who have Spanish names were of Mexican descent, then residents may have assumed that a Cuban strolling through town was a “Mexican.” But for the most part, there was no distinct “Hispanic” identity, and so Mexican-Americans in the Southwest thought of themselves as Mexican-Americans, Cuban-Americans in Florida and Louisiana thought of themselves as Cuban-American, and Puerto Ricans as Puerto Ricans. This jives with jfrankcarr’s comment: People would use “Cubans” or “Mexicans” based on whichever ethnic group they were most familiar with, or based on their assumption about the background of the person in question.
To get social scientific for a second before turning to the history, ethnic and racial categories are not essential categories, but are always constructed through political, social, and cultural struggles. Put another way, neither Mexican-Americans nor Anglo-Americans in the 19th century saw a need to talk about “Hispanics” as a single class. Cuban-Americans, after all, were likely to respond differently to the Mexican-American war than would Mexicans and Mexican-Americans. Because large scale Puerto Rican immigration and Cuban immigration to the US are primarily 20th century phenomena, there was no need for a national discourse around "Hispanic" issues and so that category did not emerge as a useful or meaningful term in national discourse. (As jfrankcarr notes, Catholicism was a hot issue in the 19th century, so "papist" was a socially meaningful term, but this covered many non-Hispanic ethnic groups.)
So when did Americans begin to think that it made sense to lump Mexican-Americans, Cuban-Americans, and Puerto Ricans together into one ethnic group? As Cristina Mora argues in a recent book and journal article, the emergence of the Hispanic identity is a recent historical process spanning the 1970s and 1980s, which was due to 1) increased immigration to the US by non-Mexican Spanish-speaking nationalities, 2) the state’s tendency to want to make society “legible” through simplifying classifications, 3) activists in the various communities realizing that they would be more powerful as “Hispanics” than as many different groups, and 4) the development of national media markets, so that companies realized it was more profitable to market to “Hispanics” than to many different groups.
As late as 1969, the U.S. Census Bureau classified Mexican Americans,
Puerto Ricans, and Cuban Americans, the nation’s three largest Latin
American groups at the time, as white, effectively lumping their
information in with data on Anglo Americans. A third-generation
Mexican American, for example, would be classified in the same
category as a person of Irish descent. By the mid-1980s, however, the
Bureau had instituted a new Hispanic category that sorted persons of
Latin American descent into their own panethnic classification. (ASR)
And it wasn’t just that the Census was behind the times. People of Latin American decent similarly did not embrace a panethnic identity:
Indeed, differences among the various Latin American ethnicities were
so vast that attempts to unite them in the early 1970s often failed.
For example, a prominent Spanish-speaking political unity conference
held in 1971 disintegrated as Puerto Ricans accused Mexicans of trying
to impose their agenda on them, and both groups questioned whether
they had anything in common with Cubans (Foley 1971; see also
Rosenthal 1971). During the same period, former census officials
recall conducting focus groups on the East Coast and in the Southwest
and finding that Mexicans, Puerto Ricans, and Cubans did not identify
panethnically: “People didn’t even know what Hispanic meant!” recalled
one official. (ASR)
But from Mora's book, today: “Hispanics in the United States represent different national origins, skin colors, socioeconomic classes, regions, generational statuses, and even languages.”
What happened in the interim? From the book:
A profound shift occurred in American history between 1960 and 1990.
During this period, federal agencies developed a separate Hispanic
category that effectively lumped together all Latin American
communities. At the same time, large Mexican American activist
organizations began courting Puerto Rican and Cuban American
constituencies in an effort to develop the nation’s first panethnic,
Hispanic political advocacy groups. Additionally, media executives
began connecting Spanish-language television stations across the
country to one another, forging a national “Hispanic” network that
reached Mexican America, Puerto Rican, and Cuban American audiences
In particular, the organizations she identifies as having set out to establish a “Hispanic” identity are the Cabinet Committee on Opportunities for Spanish Speaking People, the Census Bureau, the National Council of La Raza (a social movement), and Univision Communications Corporation (a media organization). Interestingly, she finds that these four organizations often coordinated their efforts to forge a panethnic Hispanic identity, and that some key figures even moved from one organization to the other.
As an aside, RI Swamp Yankee’s comment is probably correct, although the use of “Spanish” as a category may be regionally specific. Mora writes: “Other categorizing labels – Raza, Spanish Surname, Spanish, Latino, and Spanish-Speaking – were also employed by these actors from time to time, but none was as popular as Hispanic was between 1960 and 1990.” New Englanders may have gravitated toward “Spanish” as a general term because the Spanish/Portuguese distinction is more salient in New England due to the large Portuguese-American and eventually Brazilian-American population there.
As another aside, a similar story can be told about the creation of a pan-Asian racial group – and the pan-European "White" racial group as well.