Jim is a slave belonging to Miss Watson. As the story progresses, he becomes a more important character, playing a key part in Huckleberry Finn's numerous adventures. On their lengthy journey down the Mississippi River, he will act as a kind of mentor to Huck, imbuing him with the kind of folk wisdom which the young boy otherwise wouldn't learn if he stayed behind in St. Petersburg.
Primarily, Twain introduces the character of Jim to highlight one of the major themes of the story: the gap between how so-called civilized society sees itself and the often sordid reality beneath the genteel surface. The good folk of St. Petersburg, including Miss Watson, see themselves as the epitome of all that's decent and civilized. Certainly, no one would deny that Miss Watson is herself a fine, respectable lady, a genuinely good person.
And yet, through her ownership of slaves like Jim, she is perpetuating an evil system based on cruelty and exploitation. This theme will be further developed later on in the story when Huck winds up at the Grangerfords' estate. This wealthy Southern family also appear to be the epitome of respectability, and yet, like Miss Watson, they own a number of slaves, which calls into question their civilized self-image.