Coffee is not something we count. Meaning we don’t say “I had 3 coffees today.” For things that we count, like meals for example, we say “I had 3 meals today.”
So in the situation with coffee/tea, we would use the first and the third examples you gave:
“To have a cup of coffee/tea.”
“To have some coffee/tea.”
That is a general rule you can keep in mind for other liquids as well, like milk and water.
Hope it helps.