The question "Wie geht es dir?" ("How are you?" – informal) or "Wie geht es Ihnen?" ("How are you?" – formal) often comes immediately after a greeting. It is a standard part of the conversation, as it is considered polite to ask someone how they are doing or feeling. But be careful: sometimes people are not really interested in the answer. In a conversation with someone you don't know that well, your answer should be very brief, for example, "Danke, gut" ("Very well, thanks)".
But if a friend asks you the question, you may respond honestly and in detail, since that person really wants to know how you are.