The only time it mentioned masturbation in the Bible was in the story of Onan. He pleasured himself and "Spilt his seed on the earth" and I think for that he was punished. The reason is that they believed that men had a limited supply of semen and to waste it was a "sin."
Since then, science has proven that men produce new semen 24/7, and sometimes it is even healthy for us to relieve that pressure. Another example of an old superstition dying hard.
It said nothing whatsoever about female Onanism in the Bible, so even if you are that old-fashioned, you may as well go ahead.