what are the differences in flavors?
If a recipe doesn't specify the kind of onion, then it means they are calling for yellow onions. White onions. White onions are slightly milder in flavor and are typically used in Mexican cooking
It just depends on what you are cooking. My usual "go to" onion falls in the "sweet" category; Vidalia, Maui, Walla Walla. Otherwise turn to the common brown (Spanish) onion as they are less expensive.
Do yourself a favor - Some time when you have a little spare time (okay, stop laughing!), sample a slice of white, yellow and red onion and a bit of shallot and a green onion (scallion). Once you have tasted them all by themselves, you'll be able to tell what type will probably be best for you in a given recipe. If you have a little more time, do the same thing after sautéing each type until they are slightly softened. Sauté them in butter and that will be your reward for spending so much of your valuable time eating onions!
Ditto what WileyP says. Also, sauteing them or caramelizing onions can make them sweeter and less sharp.