When do you know what type of Spanish to speak in different countries?
You just speak any, people will understand you. Try to avoid vos in most countries until you are sure you can use it, but it is not a big problem if you use it.
Don't worry about it. It's like worrying about whether you're learning British, American, or Australian English.
I learned Latin American Spanish and I have had conversations with folks from Peru, México, Argentina, Spain, Guatemala, Colombia... other than slang, the odd different word/meaning here and there, it's all pretty much the same. If you speak standard Latin American Spanish you will not have any trouble at all being understood no matter who you talk to.
The only thing I've noticed in Spain was that the accents were a bit different. And... a few words, mostly related to food, were different. That's it.