Let me explain myself further. I currently have a bachelor's degree in history. Currently I teach and I truly do love it, I also live in a state where having graduate degrees wouldn't net me any more income so right now I'm not sure it would make much sense to go to grad school. But I still love the idea, as there are a lot of days where I miss reading hundreds of pages and doing research.
I haven't ruled out pursuing higher ed, I know it's super competitive and all. But anyways I oftentimes read works form historians where they talk about how they spent months or even years on end living in other countries to do research that pertains to their thesis. For instance I'm big into Latin American history, one of I think, the best works of history I've ever dove into was Jon Lee Anderson's massive Che Guevara biography. He said he spent like a year living in Havana to do research. I know he wasn't a student at the time, but I had a professor in college and I believe he told me lived abroad while doing research for his dissertation.
Does the school you are studying at pay for you to go abroad? Like how does that whole thing work? I'm currently kind of entranced with the idea of pursuing a doctorate and getting to live somewhere in Latin America for some time while doing research. I guess what I'm asking is how do students get to make these arrangements where they are still students in America but get sent abroad to do research? Is this rare or pretty common or what?
If you're extremely lucky, you get a job at a research project while doing your phD which includes a stay abroad to research on-site. That is usually for a few months, depending on funding and necessity. (I was extremely lucky and got a year abroad this way.)
Otherwise, it's hunting for grants and stipends offered by various organizations (public as well as private) to obtain funding. These rarely pay for more than a year at best. Which, of course, means you have to pitch your project as being relevant to the field, the stay is necessary, and otherwise all kinds of amazing blah blah blah.
Of course, there are alternatives. For example, a friend of mine is in his fourth year abroad now because his wife found a job in the city he researches in... That's not something I would account for in my planning, though :)
Moreover, many institutions require you being affiliated to an University or other academic research institution as a requirement to permit your using their archives as an outsider, so the option of just "being rich" might bring its own complications.
This can vary by program, but the first two-ish years of an American PhD in History are coursework. After that you take a huge exam ("Generals," "Orals," "Quals," whatever it is called where you are), and write up a dissertation proposal. If that is all good then you are "ABD," all-but-dissertation. So for the next 4-6 years (or more) you are meant to be "dissertating," the process of researching and writing your dissertation. In practice, unless your program is extremely generously funded, this means you are often doing research and teaching for professors at your university to pay the rent (while trying to do whatever local research for your dissertation you can do), but if your research needs require travel you'll need to figure out how to do that.
Usually coming up with the funds for this involves applying for grants, both internally (within your department or university) and externally. There are foundations that fund dissertation research, like the American Council of Learned Societies, and often archives and libraries will have small research grants themselves to pay for you to use their materials (this is how they justify their existences). So you spend a lot of time applying for these things. Usually the grants are not very large — a few thousand dollars to pay for airfare and an AirBnB or cheap motel. There are larger fellowships available for people who need to be in an area for longer duration than that, as well, though even these are pretty meager dollar-wise compared to a real career. You can just barely make it scrape by if you are very frugal (or have some external funding source, like parents or a spouse, which is more common in my experience), but part of the grad school experience is essentially eating nails for several years.
The consequence of this is that a lot of people are encouraged, either explicitly or by circumstance, to choose dissertation topics that don't require living in some distant locale for a long time. Though it is usually a bad sign if all of your research can be done at your local university, a topic that requires a lot of travel is a logistical nightmare unless you have a lot more independent wealth than most grad students.
My sense is that over the last 20 years or so, the practices of this have changed a bunch. It used to be that one was expected to essentially take up residence next to the archives, and spend the entire summer carefully looking at all of the relevant materials and taking careful notes on them. This is tremendously expensive, as you can imagine, both in terms of time and money. More common, at least since I was a grad student (I got my PhD 10 years ago), is an "archive run" where you bring a digital camera (the whippersnappers today use their smart phones, but I used a real camera) and photograph as much material as you can before the doors close each day. If you do that, you can essentially take the archive with you, and then look it over more closely at your leisure when you are not on the road. (The other advantage here is that you don't need to be in an archive anymore — I hate archival reading rooms. Too quiet, too many restrictions on what you can do.) I still regularly use archival files I photographed during my dissertating time; I don't have a good count of how many pages I photographed back then, but it is probably on the order of 10,000 or so over the course of several years. So that's a good archival base to work at for a long time.
It's been a stretch of time since I've even been in an archive, I'm a little embarrassed to say (and under the present pandemic conditions, I am sure it will be some time before I'm back in one). More commonly these days is that I use a finding aid to figure out what I'm interested in (a folder or set of folders) and just order photocopies from the archive. This costs money, and certainly decreases the amount of material I can look at, but I'd rather pay $200 for a folder or two of materials than $4000 for a trip that may or may not net me more than a folder of two of useful materials (whether this trade-off works depends on the archive and the research question you're trying to answer — this is how I interact with small university archives, it is not how I would try to use the National Archives, which aren't set up to do this kind of thing very well). But it also helps that now I am a professor with a decent salary and a research account, and exchanging money for convenience is a luxury I did not have as a grad student.
For professors there are more options for funding and research, and of course they get paid more than grad students, and we sometimes have university-provided research accounts. And if you are writing for a popular press (Knopf, FSG, etc.), the alleged use of a publication advance is to fund these kinds of activities as well.