Good (adjective): such as should be desired or approved, right, satisfactory; sound, unimpaired; not depressed or dejected.
Well (adverb): free or recovered from illness; in a satisfactory state or position.
One can safely answer with either response and be grammatically correct, however the manner in which the question (How are you?) is asked must be kept in context.
If someone is clearly inquiring about your health, “I’m well,” is the normal response. If it is clear you are in good health, either responses are correct; although some people prefer to use “well” in more formal situations.
From Merriam Webster, "Good vs Well"
An old notion that it is wrong to say "I feel good" in reference to health still occasionally appears in print. The origins of this notion are obscure, but they seem to combine someone's idea that good should be reserved to describe virtue and uncertainty about whether an adverb or an adjective should follow feel. Today nearly everyone agrees that both good and well can be predicate adjectives after feel. Both are used to express good health, but good may connote good spirits in addition to good health.