You can take a look here: https://www.duolingo.com/comment/16296174 and search for topics about cases.
One thing that you can be sure of: the subject of the sentence is in Nominative, the most basic form. Here it is not visible, because "Mam herbatę" = "Ja mam herbatę", but "ja" is totally redundant as the subject is obvious from the verb's form.
"herbata" - the basic, Nominative form, used mostly for the subject of the sentence.
"herbatę" - the Accusative form, used for the direct object of the sentence. So the verb "mieć" (to have) will take a direct object in Accusative. For some grammatical genders Accusative is identical to Nominative, but here, for a feminine noun, they are different.