I have heard it many times in movies and shows. I think it means "I do not feel very good" or "I do not feel as good as you think", but why do we use "that" here, and is it correct?
When someone says 'he/she is not feeling that good' conveys the message that they are not feeling good up to a certain point/level which they normally do in the same condition.
Certainly they are feeling good but not to that level.
Lets take an example:
A business man makes profit of 25% from his business while in the past he made a profit more than 25%, lets say he made 40% profit in the recent past.
In the situation above, the business man can say: He did not make profit that much.
Hopes this helps.
If both the sentences you have written are taken to mean the same, then 'that' is an adverb used for a degree of comparison. It compares the actual state of the person to the state assumed by the asker.
But then, this is an informal usage. We do not use such sentences in formal writing. In fact, the use of the word 'good' itself is incorrect. One should say, "I do not feel quite well." When we ask someone, "How are you?" we want to know about the person's wellness, not goodness.
Like many other sentences in the English language, this sentence has become acceptable due to widespread usage. But, to be grammatically correct, one should say, "I do not feel quite as well as you think." The sentence with 'that' must be avoided.