Yes, this does seem to have happened on some galleys but evidence for the widespread use of this practice is lacking. Concerning conditions in general on galleys (rations, clothing, treatment etc.), it's important to note that different navies had different practices at different times.
This practice is mentioned in Robert C. Davis' (Professor of History at Ohio State University) Christian Slaves, Muslim Masters: White Slavery in the Mediterranean, the Barbary Coast and Italy, 1500 - 1800:
to make sure that none of the slave oarsmen spoke out and gave the
game away, all the rowers were gagged with "a morsel of cork that they
carry for this purpose, hung about their necks like a reliquary sack."
One of Davis' sources for this is the first-hand account of João Mascarenhas, who was captured and became a slave rower on an Algerian galley in 1621.
John E. Rybolt of DePaul University in Vincent de Paul and the Galleys of France also mentions this:
Each rower was issued a large piece of cork attached by a cord around
his neck. This plug (the tap en bouche or bâillon) kept them quiet
when silence was important, so as to better hear commands or be
unheard as the galley moved.
Vincent de Paul (1581-1660) was a French priest who claims to have been captured and sold into slavery, though the authenticity of his account of his enslavement has been questioned. However, there is no doubting that he had an in-depth knowledge of galley slaves as he was 'Royal Chaplain of the Galleys of France' and had extensive contact with galley slaves.
A couple of points to note:
The practice of putting a cork in the mouth while rowing would only have been deemed necessary when silence was essential. Also, the use of cork gags may have been phased out during the 17th century and / or was not practiced by all Mediterranean fleets; the condemned French Protestant Jean Marteilhe’s autobiography makes no mention of it and nor does Paul Bamford’s Fighting Ships and Prisons: The Mediterranean Galleys of France in the Age of Louis XIV in the 25-page chapter ‘Life Aboard’.
Also worth noting is that not all galley rowers were slaves, particularly on the Ottoman galleys which preferred paid oarsmen. Pieter Geerkens’ comment may be pertinent here – use of the cork may have been at the discretion of individual rowers, or it may been forced in the case of enslaved ones who would have a motive to compromise their own ship.
The article The Rowers on the Order's Galleys (c. 1600-1650) by Joseph F. Grima in Journal of the Maltese Historical Society. 13(2001)2(113-126) gives some idea of how conditions varied among the different navies (the whole article can be read online at the link above).