How do we know that Mayella Ewell is lonely?
The reader knows Mayella Ewell is lonely because of the testimony at the trial of Tom Robinson.
As Tom gives his testimony, Scout realizes that Mayella, the woman accusing Tom of rape, is incredibly lonely. She thinks:
As Tom Robinson gave his testimony, it came to me that Mayella Ewell must have been the loneliest person in the world. She was even lonelier than Boo Radley, who had not been out of the house in twenty-five years. When Atticus asked had she any friends, she seemed not to know what he meant, then she thought he was making fun of her. She was as sad, I thought, as what Jem called a mixed child: white people wouldn’t have anything to do with her because she lived among pigs; Negroes wouldn’t have anything to do with her because she was white.
Scout can see that Mayella is so lonely that she called Tom to spend time with her. She asked him to do work at first, then would regularly start conversations with him. She had no one else.
Even though Mayella has a large family, she has no real friends. She is likely abused by her father and spends all her time in the company of children. Maycomb doesn't see the Ewell family as good people; they ignore Mayella and are not willing to spend time with her.
Her mother is dead and now Mayella cares for her siblings. She is extremely isolated from the rest of the town and doesn't have experiences a woman her age would normally have.