Tu as --> you have (avoir)
Tu es --> you are (être)
Your examples:
Tu as faim --> you have hunger
Tu es content --> you are happy
It's kind of based on what "makes sense". The more you speak the more of a feel you'll get for knowing which to use.
As others have pointed out, the verb "faim" means hunger. In English, you have hunger, so in this case, it is a direct translation.
An example I remember is that you can say "J'ai fini..." as in "I have finished..." this project.
But, saying "Je suis fini..." makes no sense because you are saying that you are finished, as in you are dead...
In a way, French is more literal.
The difference is important but don't worry because you'll get it with exposure and practice, over time.
I hope this helps :)