This is a really tricky question for people who share a room with someone else. In general, I think it's going to be best to masturbate when you are alone, since it can be hard to know if someone else is actually asleep or knows what's going on or not and it's an uncomfortable position to put someone else in.