The comparison/contrast between the raft and the shore boils down to one issue: freedom. On the river, Huck and Jim are liberated from the legal, societal, and cultural strictures that otherwise would be applied to them on the shore. On the raft, the two characters are, for however brief a period, truly free.
Once they set foot back on shore, all the laws of man once again rear their ugly heads, and Huck and Jim are forced to comply. The similarities between raft and shore are mostly natural in comparison: Both are geographical features, and both are part and parcel of one another (you can't, for instance, have a shore without a body of water). Outside the literal nature of the two elements, however, few similarities exist, as life in the two separate locations is so vastly different for the characters in question.
The main difference is that when Huckleberry and Jim are on shore, the rules of society are imposed upon them. These rules change the relationship of Jim to Huck, as well as the moral code. On the raft, Jim has no labels, prejudices, etc. attached to him while Huck, too, can follow his conscience and not be forced to act according to the standards of his race and area.
In order to compare/contrast the way in which Huck's and Jim's lives are affected in each situation, you need to review key incidents and passages in the novel which point out similarities and/or differences.
See the writing lab for tips. You may wish to visit the sites below. Good luck!