botched the first sentence by over-editing.
"When men live with their girlfriends who are mothers of preschool boys - "
I agree with everything AJ said, and I'll add this.
When men who live with their girlfriends, who are mothers of preschool boys - the relationship almost never works out. Sometimes the relationship lasts awhile, but it doesn't "work out" from the perspective of a happy child and a happy mother.
I agree with AJ that you need to have more understanding of toddler behavior - but honestly I think you need to move out. A single mother with a toddler boy is a hard enough row to hoe, without having a boyfriend there nagging her that she's doing it wrong and complaining about the child's behavior.
Rough stuff to say, I know, but stay there awhile and I think you'll agree with me.
There's not a whole lot you can do; as of right now, you're just the mother's parter, not her husband and not the boy's step-father. So it's not your place to step in and try to play a parent role (unless you've been in this relationship since the boy was an infant). This is a very touchy part of being in a relationship with someone who has kids from a previous relationship.
The boy's level of defiance is based on what his mother (and father, if he sees the child) lets him get away with. You said if he wakes in the middle of the night calling for her, she goes to him and tries to calm him, but he argues with her. It's pointless and unproductive to "argue" with a toddler. If he calls for her, then wants her to go away or smart off to her, then she just needs to give him a hug and kiss, say night-night, and leave it at that. That's all the more comfort an arguing, defiant toddler needs; she needs to be patient with him but not let him run the show. If he needs to scream himself back to sleep, so be it--or at least wait until he calms down enough and she can go and tuck him back in and give him another kiss and hug right as he's about to fall asleep.
When she's in the bathroom and he's beating down the door, she needs to ignore it or make sure she has found him a distraction for those few minutes of private time.
You can try all you can to step in and calm him, but if he's not bonded enough to you to care (and it sounds like he's not) then you have to realize that trying to step in and force your good will on him can do more harm than good. If he wants nothing to do with you, then you've just got to let it be and let time establish a bond.
If you can't handle it, then maybe this relationship isn't right for you. The child should always come first with the mother, and you need to view the relationship as just a relationship, not a co-parenting team, until time has allowed it to be so. I commend you for wanting to help and having concern, but it's so important that you don't overstep any bounds. If she's not asking for parental help (i.e. "You go comfort him at night or entertain him instead of me so I can have a break."), then you need not feel compelled to give it. Like I said, that can do more harm than good.
And as for her getting rest, I'm sure she's used to lack of sleep as a single parent to a toddler--I know I am. It's part of the package and it probably doesn't bother her nearly as much as you're concerned about.
Ask her how you can help and if she even wants your help. Maybe read some chapters from "What to Expect the Toddler Years" to find out more about child behavior if you're really that interested in building the relationship to the point of playing a parental role to this boy.