X: "Vivillon with many different patterns are found all over the world. These patterns are affected by the climate of their habitat."
Y: "The patterns on this Pokémon’s wings depend on the climate and topography of its habitat. It scatters colorful scales."
Your pattern is assigned based on your 3DS profile settings. It depends on both your country and your region. You set up your region manually. If you don't set up a region, you get the default for your country. You only can find one pattern in the wild. Changing your settings mid-game doesn't affect the pattern you get. Changing your settings works if you do it before starting a new save.
If you get a Scatterbug from another player, it will evolve into the pattern from that player. When you breed Vivillon, your region will assign the pattern regardless of its parents.
Using the Köppen climate classification map, you may be able to predict and plan trades and wing patterns however this may be difficult to accurately use.
Fun Fact: Vivillon's name is pronounced Vihv-ee-yawn. This is based on its Japanese name, Bibiyon, and its English derivative, "vivid' and the French word for butterfly "papillon" (pronounced pahp-ee-yawn).
UPDATE: Rumors are floating around that there are more Vivillon wings to be found. Please feel free to discuss but know that the reality of the situation is that information is rumor and speculation at best!
Wing Patterns and where they are found
Country/Region list is nearly complete!