First of all, there are really no incorrect answers to this question. Likely, your teacher is looking for an in depth explanation of your thoughts and opinion. Therefore, in order to fully answer this question, you must do two things. First, define family. Second, provide examples for your answer.
Personally, I'd answer this question by saying that family consititutes the people in an individuals life who love, care for, and support that person unconditionally. It could also be added that people do not necessarily get to choosetheir family. According to this criteria, yes, both Jim and Tom become family for Huck.
Tom Sawyer is Huck's best childhood friend. This is shown in the very first chapter of the novel:
Now she had got a start, and she went on and told me all about the good place. She said all a body would have to do there was to go around all day long with a harp and sing, forever and ever. So I didn't think much of it. But I never said so. I asked her if she reckoned Tom Sawyer would go there, and she said not by a considerable sight. I was glad about that, because I wanted him and me to be together (chapter 1).
As an orphan, though Huck does not have any real brothers and does not understand what a traditional family feels like, he finds a brother in his friend Tom.
Then, Jim and Huck support one another in their journey along the river. A relationship that begins somewhat selfishly for each (self-survival) becomes one of friendship and brotherly love by the end of the novel. Both Huck and Jim prove this. Huck proves this in his promise to free Jim, and Jim does so simply in his ongoing sense of loyalty to Huck:
"Pooty soon I'll be a-shout'n' for joy, en I'll say, it's all on accounts o' Huck; I's a free man, en I couldn't ever ben free ef it hadn' ben for Huck; Huck done it. Jim won't ever forgit you, Huck; you's de bes' fren' Jim's ever had; en you's de ONLY fren' ole Jim's got now" (Chapter 16).
As you answer this question for yourself, I encourage you to come up with your definition of "family," and then find evidence to support it from the text.