Evidence suggests that we've been enjoying onions with our meals since at least the time of the ancient Egyptians. These versatile treasures are known for enhancing dishes with either sweet or savory flavors, depending on the type of onion used. While the different types are mostly recognized by their color, onions are divided into two main categories: dry and green.
Green onions that are harvested while their shoots are still young and green and are usually chopped and used for toppings on salads, for soups, and on baked potatoes. The only green onions we really consume are what we call scallions. Also related to them are leeks and chives.
Dry onions are further broken down into two categories: spring/summer onions and fall/winter/storage onions. In the fall onion varieties you will find the familiar yellow, red, and white onions and also shallots. They are harvested once the shoots have died and the onions are left with a paper-like covering encasing the fleshy inside, making them ideal for storage. Storage onions are best used in savory dishes that require simmering or long cooking times.
Spring onions are usually sweeter than fall onions, but do not store as well. Among the spring onions are the Peruvian Sweets, Walla Wallas, and the Vidalias, named after their growing region in Vidalia Georgia. With their delicate taste, spring onions are an ideal choice for salads and other fresh and lightly-cooked dishes.
Of course, in a pinch you can probably get away with using whatever onion you have on hand. I almost always keep some Spanish yellow storage onions on hand in my kitchen. But when I know I have time to shop for specifics, I'll generally use:
white onions for Mexican dishes
red onions for grilling (and sometimes in salads just for color).
sweet spring onions for salads, or as raw toppings on hot dogs, burgers, and cheese steaks (I'll caramelize yellow onions if I don't plan to have raw toppings).
yellow onions for any soups, stews, roasts, or chili.
While I love them both, I generally only use shallots and scallions for dishes that specifically call for them. Otherwise I'll use whatever I have on hand at the time. Of course, onion usage is probably the one area where I'm not a martinet in the kitchen.