Visa requirements can be a real pain in the ass for world travelers. Every country is different. Some do not require visas. Some provide visas on arrival. Some require that you send your passport to the country’s embassy to apply for a visa before you travel.
The article below covers almost all the issues you might need to understand with regards to foreign visas. Read it and learn.
The Longest Tourist Visas for U.S.A Citizens, How to Extend Visas and More