A bachelor party is a celebration of a man's last days before marriage.
In 2374, a Klingon ritual known as the kal'Hyah was held for Worf by General Martok in a Deep Space 9 holosuite. Benjamin Sisko, Miles O'Brien, Julian Bashir, and Alexander Rozhenko attended, under the mistaken impression that the ritual would be the equivalent of a four-day Human bachelor party. (DS9: "You Are Cordially Invited")
In 2375, Benjamin Sisko asked his son Jake to be his best man at his wedding to Kasidy Yates. The younger Sisko noted that his responsibilities would include planning a bachelor party. (DS9: "Penumbra")
There is also a female version of the bachelor party known as a bachelorette party.