According to google:
"Y" is a Vowel when when it makes a vowel sound (like a long "e" or long/short "i") with no obstruction of airflow.
• At the end of a word: happy (long "e" sound), cry (long "i" sound).
• In the middle of a word or syllable: gym, system, myth (short "i" sound).