"I need a ticket."
Translation:Yo necesito un boleto.
Here is an interesting thread that may be of use to you: https://forum.wordreference.com/threads/boleto-o-boleta.893797/
It's the difference between masculine and feminine gender.
Most words that end in "o" are masculine, and most words that end in "a" are feminine.
There are exceptions, but this rule works for this question.
You use "un" with masculine nouns (usually ending in "o") and "una" with feminine nouns (usually ending in "a").
Fifty some years ago when I started studying Spanish in high school, "Necesito un boleto." was correct and informal (although I learned "billete". Adding the "Yo" was more formal. The Spanish I learned was that of Spain; Duo is teaching us that of Latin America (which makes sense). Spanish on either side of the Atlantic has changed since I was a student (The informal "vosotros" has changed to "os" in Spain while Latino America doesn't use it at all, apparently). That's okay--It gives me a lot to complain about.