Isn't it supposed to be "gosto" because its masculine
No. This is a verb, not an adjective. http://www.conjuga-me.net/verbo-gostar
You conjugate verbs when they work as adjectives.
Gosto is "I like", and gosta is she/he/it "likes". It is a verb, so you must conjugate it.
Is "Ele gosta de o café?" fine?
No. De + o = do. And you'd use that just for specific situations (in this case). Ex: ela gosta do café colombiano (she likes the colombian coffee)
"He likes coffee" and "He likes the coffee" have different meanings in English too