“Pipe down,” which is a request to be silent, originates from one of the sailing ships signals which were given to the crew by sounding the boatswain's pipe, according to www.phrases.org.uk.
'Piping down the hammocks,' was the signal to go below decks and retire for the night. When an officer wanted a sailor to be dismissed below he would have him 'piped down'.
This usage is recorded in Royal Navy workbooks from the 18th century, such as Gillespie's Advice to Commanders & Officers, 1798:
"At four o'clock, P.M. the hammocks should regularly be piped down."
However, www.phrases.org.uk states:
“There's no unequivocal link between this naval practice and the 'be quiet' meaning. It could well have derived from the fact that, if there was a disturbance onboard ship, officers could quell it by sending the crew below decks, that is, by piping them down. This notion is supported by records of ship's crew's being told to 'pipe down' rather than signalled to by the use of an actual pipe; for example, this report from The Gettysburg Star And Banner, April 1850:
“'I don't care what happens to me now!' wept Peter, going among the crew, with blood-shot eyes, as he put on his shirt. 'I have been flogged once, and they may do it again, if they will. 'Let them look out for me now'. 'Pipe down!' cried the Captain, and the crew slowly dispersed.”