First, lets just be clear about what a visa is.
A visa is an indication that a person is authorized to enter the country which “issued” the visa, subject to permission of an immigration official at the time of actual entry. The authorization may be a document, but more commonly it is a stamp endorsed in the applicant’s passport.
Some countries do not require a visa in some situations, such as a result of reciprocal treaty arrangements. But truth is that over 80% of countries require travel visas for entry. When required, the country issuing the visa typically attaches various conditions to the visa, such as the time that the visa is valid, the period that the person may stay in the country, whether the visa is valid for more than one visit, etc.
There are more than a dozen types of visas but they can be generally classified as immigrant visas and non-immigrant visas. Non-immigrant visas are usually for tourist and business visitors. United States as well as most countries requires visas for certain travelers to enter their territory. In many cases, the need for a visa depends on the length of your stay.
Many countries, like Chile, Peru, Thailand, Western Europe Countries, and many others, will let you enter with just a valid passport and the return flight information (applicable to US passports and most First World countries). They usually let you stay between 30 to 90 days.
Some countries, such as Egypt, Cambodia, and Bangladesh, will allow you to enter with an airport visa or landing permit which you pay on arrival. Be aware that depending on your arrival schedule at your destination, sometimes obtaining this visa can be time consuming because the operation hours of the “visa acquisition” facilities are not necessarily coordinated with flight arrivals (i.e. late night arrivals).
US Citizens, carrying US passports, can check which countries require a visa in this wikipedia page. But more importantly, you can check all the entry and exit requirements for each country in the US Department of State travel page. It is important to check these details well before your departure to make sure you have all the necessary documents at the time of arrival.
If you carry a passport from another country, you can do a google or wikipedia search with “visa requirements for (country) passport” and it will show you the countries that will require you to apply for a visa with your specific passport. Or, you can go directly to your government’s travel/immigration page to get more details.
As you can see, visa requirements vary from country to country. For most countries that require a visa upon entry, you must obtain your visa before you depart your country of residence, or on arrival (if the option is available for your passport). Your destination might ask for additional prerequisites like a passport with at least six months or more of validity, a full blank page for the country’s visa, and in some less developed countries, evidence of yellow fever and other vaccinations. Get more information about travel vaccination.
Today, with the internet, it is really easy to apply for a visa. Companies like VisaHQ.com will process your visa application for the cost plus a small processing fee. Your other option is to visit the nearest embassy or consulate for that country and apply there. If you happen to be visiting the embassy of your destination of interest in a foreign country, make sure that they will process your new visa within the time you’re spending in that country, since sometimes visa processing can take days or weeks.