Are W and Y vowels? I learned it depends on the conditions. But I don't know what conditions.
A "vowel" in an alphabet is a letter representing a sound with with a sustained voiced tone using an open throat, mouth and lips, usually differentiated by the position of the tongue and lips, as compared to a "consonant" which is any other phoneme, usually characterized by lip and teeth positions (labiodental, bilabial, alveolar, glottal), instant or sustained (plosive, fricative) and whether voiced or unvoiced. Vowels are always voiced, and have no attack of their own.
So, by this definition, yes, "y" and "w" can represent vowel sounds in words. Usually, when they do represent vowels, they are used in conjunction with one or more other vowels to create a polypthong: "w" represents "oo" and "y" represents "ee". For example, the word "way" is pronounced "oo-a-ee". "sweet" and "how" are other w examples, while "hay", "say" and "yes" are good examples of Y's normal behavior. This makes the letters Y and W best described as "vowel modifiers". They are rarely seen representing their voiced sound without another vowel adjacent, so they are not considered full vowels.
Further complicating things, w has both voiced and unvoiced qualities, a result of the evolution of the Latin alphabet to replace runic alphabets in Germanic languages. It also picked up other tricks; W in combination with H is usually unvoiced (though some dialects voice "wh" as if it were "w"), representing an unvoiced rounded lip alveolar fricative; basically forming "oo" and saying "h". Also, depending on the word origin, "w" may use its Romantic pronunciation of the semi-voiced labiovelar approximant (a "soft v").
"Y" has no such multiple personalities; it is always a vowel or vowel modifier trending a monopthong or dipthong vowel sound toward "ee". However, it is rarely seen on its own; the main exceptions are as the last sound of a word such as "Christianity", "slowly", or "happy". In most other cases, if "ee" is desired, it is used, or alternately the German-derived "ie". So again, since it rarely stands on its own, it's not considered a "full" vowel.
A vowel is basically a letter you pronounce with an open vocal tract. Y is a semivowel because sometimes you pronounce it with the tract open (as in sky) and sometimes not (as in yesterday). Pay attention to the position of your tongue when pronouncing vowels and consonants and you will notice the difference.