It strikes me in your post that you feel your son is too young for a talk on sex and masturbation. Exactly how old do you feel he has to be? Do you want to wait so long that when you finally do sit down to talk, he can tell you more ways to have sex then you currently know about for your own self?!!
If your son is engaging in masturbation...you need to look at the fact that he's DOING this NOW!...and not focus on his age. Besides...as much as parents hate to wrap their minds around this one...there are MANY 13 yr. olds having sex. Check the stats...it's pretty scary when you see 12 and 13yr. olds having babies...and it's not because they were raped.
Maybe a small part of why your son is masturbating has to do w/ the fact that he has questions. He has hit the age of curiosity. The biggest favor you can do for your son is to sit down w/ him and have an open and honest talk. Let him know you are aware of what he's done in your bed. Tell him although he should feel no shame in this act, you'd feel more comfortable if he kept this to either his own bed, or bathroom and let him know he's expected to take care of his own "mess"! The more open and matter of fact you can talk w/ your son, the better. You don't need to be all flowery in your language! Shake w/ emotion and fear on talking the subject on the inside but try to appear calm on the outside! You know there is no shame in this, now is the time to let your son know. He needs to know that masturbation in itself is not shameful. But he also needs to know that there are appropriate times, places, etc. to masturbate. Ask him if he has any questions on sex. Ask him if he has a girlfriend ...ask him if he has thought about having sex...find out just how far that goes.
But do your son a favor. Don't stick your head in the sand and pretend nothing is going on because you don't want to embarrass yourselves. Talking about sex.....well there are a lot of things we talk about w/ our children that can sometimes bring about a sense of uneasiness...but it's our job as parents to talk w/ our kids and educate them. I know you feel 13 is young and he might not be ready for the "sex" talk....but again....I encourage you to give your son more credit for his age...remind yourself of the type of society we live in and it's attitudes on sex...and realize that if he's already masturbating in YOUR bed....what better time is there then now to talk to him? ............you said that this topic has not yet come up? Are you waiting for him to come to you? That most likely will not happen. I think you've just found your cue....YOU need to approach him!
As far as your girlfriend goes....maybe for now start out w/ the sex conversation. If in the course of your talk you feel concerned that this has anything to do w/ your girlfriend and his feelings about her...whatever that range could be....approach it then. Take it slow...but I can't stress enough for you to be open and honest. And make it so that he knows now...early on...when he needs some straight talk ...he can count on his dad! Our kids should feel that when it all comes down to it...they can turn to us and talk to us. They shouldn't feel they have to hide from us...least not important things like this topic. Adults say how they want their kids to be able to talk to them about sex, drugs...all those big teen issues.....well...we have to help them bridge that gap in communication!!!