"forchetta" ends in a, so it is feminine. "garfo" ends in o, so it is masculine. The femininity or masculinity does not really depend on the meaning of the word.
Mostly ends in "o" = masculino; ends in "a" = feminine. Nouns and articles. the boy = o menino (masculine) a menina (feminine) the water = a água ; the bread = o pão; the dog = o cão,o cachorro (masculine) or a cachorra, a cadela (feminine)
Some Portuguese words like garfo are completely different than the same word in French or Spanish. Yet many others are the same which makes learning tricky.