The mid-twentieth century setting influences the story because there are strong racial and class divisions in the working class town.
The setting of the story is not distinct, but it takes place sometime in the past. This is because it is important that the events happened long enough ago to be remembered just enough to become the stuff of local legend. Basically, Maniac is a homegrown myth for the twenty-first century kids. Just listen to the opening line of the story.
They say Maniac Magee was born in a dump. They say his stomach was a cereal box and his heart a sofa spring. (Before the Story)
This opening intentionally echoes American tall tales like Buffalo Bill, Paul Bunyan, and Johnny Appleseed. It’s clever and funny and pulls at the reader’s heartstrings, catching our attention and immediately establishing Maniac as larger than life. The reader instantly expects distance and magic from him, not reality. The narrator even jumps even, reminding us.
What's true, what's myth! It's hard to know. (Before the Story)
The actual time period is most likely the mid twentieth century. The town is working class, called Two Mills Pennsylvania. The name itself reflects the factories the workers might have labored in all of their lives, and that the towns might have depended on.
Like most of America during the fifties and sixties, Two Mills is strongly divided by race and class. This is evidenced when Maniac, whose lack of family makes him metaphorically a creature of myth and not flesh and blood, does not know racial taboos.
Amanda was suspicious. Who was this white stranger kid! And what was he doing in the East End, where almost all the kids were black! And why was he saying that! (Ch. 3)
It is because Maniac is so odd that he is able to break racial barriers. He lives with a black family, for a time. He moves freely from place to place, because he belongs nowhere. Ultimately, he is able to return to the Beale family, even though they are black and he is white. For Maniac, it is his admission that he is a human being and not the stuff of legend. It is also a time of renewal and maturing for America, than a black family could adopt a white boy informally.