Thank You, M'am is a short story by Langston Hughes. In discussing the author's purpose, a reader should consider whether the story informs, entertains or is intended to persuade the reader to a certain point of view. Although this story is not autobiographical, Langston Hughes did grow up with his grandparents and so may have lacked parental influence, such as Roger apparently does; Mrs. Jones questioning him as to who might be at home only to discover that there is no one "to tell you to wash your face."
The strong and kindly Mrs. Jones has a very nurturing sense (fortunately for Roger) and Hughes wants the reader to understand that there are people in the world who have a deep understanding of human nature and who have no need of self-gratification; their only desire is to make the world a better place (such like a grandmother may do).
Hughes could have taken this story in various directions but he chose the one where the positive role model has the potential to change someone's life. Hughes also does not make the story too much like a "happily ever after" because he leaves an open end and the reader can make his own decision as to whether Roger goes off to steal from someone else or whether he has learnt a valuable lesson and goes away reformed and with the intention to "behave yourself" which is Mrs. Jones's only request.
Therefore, this story entertains the reader and hopefully subtly also teaches the reader that a sense of empathy and a non-judgmental outlook are preferable to a cynical outlook. Hughes therefore also intends to persuade his reader not to waste their their own opportunities to be role models.