At the most basic level, in the United States you almost always need a Ph.D. in History or a related field. With only a year or two of teaching experience as a teaching assistant, you could conceivably get a job at a small community college. The higher you set your sights the more experience you need. More prestigious schools like a small liberal arts college will want more experience in teaching, references, and some minimal research or publication experience. Research oriented universities like a large state college are going to want publications, articles, books, and proof you can get grants and money for your department in increasing amounts. Almost all of these positions are highly competitive so distinguishing yourself is important.
This is just a general outline, there is no real set path to guarantee your a position teaching at college. Many more people graduate with Ph.D.s than positions open every year. The more you are willing to settle for a lesser position or move around the country the greater your odds.
Would that we knew the answer!
The first thing you should know is that the job market right now is terrible. Universities (in the US, and also increasingly the UK) are giving more and more of their courses to part-time instructors who make sometimes as little as $1500 per class (ie, not enough to live on unless you have a spouse you can depend on for your primary income). There are still full-time jobs (some tenure track, but more and more lecture positions that have lower job security), but the competition for these full-time positions is fierce. It's not uncommon to see 100-200 people apply for each position. Someone gets these jobs, and if you're excellent, and especially if you go to an Ivy League school for your PhD, you'll probably end up somewhere in the end. But now is not a good time to get into the profession. Perhaps, by the time you finish your PhD, things will be different? But people have been saying it will get better for almost a decade, and this hasn't yet happened.
Grim warnings aside, if you want to teach college you need a PhD. How do you get there?
Prepare during your BA. Getting a PhD in any historical field except American history requires languages (for medieval history, you need to read Latin, and usually also German and French; Latin America? Spanish and Portuguese, perhaps some native languages depending on your interests. Etc). It requires great grades. It requires a writing sample: a high-quality research paper of around about 20 pages that demonstrates you know how to write and research well (this is sometimes your senior thesis). You'll need letters of recommendation from usually three faculty (not TAs), so get to know your professors well (stop by office hours, talk about the material in class, write excellent papers - they'll need to praise you in these letters, so give them something to work from). And you'll have to take the GRE, which is like a harder version of the SATs.
Go to grad school. Grad school is expensive, but you shouldn't pay for it. All the good PhD programs will pay for your tuition and give you a stipend to live on (maybe not live well, but stipends are usually enough to cover room and board). You might have to get an MA before you can get into a good PhD program, and not all MAs are funded (though some are) - it can be justifiable to pay for your MA, but be careful not to pile up too much debt (remember what I said about the job market: you don't want to be saddled with $50,000 debt while staring down unemployment). Once you have your MA, apply for PhD programs at the best schools in the country; for better or worse, prestige matters in academia, so the better the reputation of the school you attend, the better your odds of landing a good job.
When you get to grad school, you start building your CV to make yourself as employable as possible. To be marketable, you need to publish at least one article in a good journal (more is better). You need to teach at least one course as the sole instructor of record (more is better - but only too a point; too much teaching keeps you from finishing everything else you need to do). You should apply for and win a major national grant to fund at least a year of your research (a Fulbright, something funded by the Mellon Foundation, etc); this proves your research interests people outside your university, and is good preparation for the kind of self-marketing you'll need to do to land a postdoc or full-time professorship. You should attend and present research at conferences; go to the AHA several times, and organize a panel there by your last year in grad school. Make connections with major scholars outside your program so they can write you letters of recommendation when the time comes. Always plan several steps ahead. Do all this, and you'll be in the top of the pack on the job market - but it's crowded up there, and you'll still have to fight your way through to land a position.
People do it. I'm on the job market right now, and not yet full of despair. You can do it too. But you'll be doing it for love, not a guarantee of a career.
If you want to learn more about getting into (and through) grad school in history, we have a great series of discussions here on AskHistorians that you should check out.