Though expressly forbidden by the Treaty of Algeron, there were occasions when Federation ships had cloaking devices. These include (but are not limited to):
-In the episode of Star Trek, The Enterprise Incident, Captain Kirk stole a Romulan cloaking device, and Scotty connected it to the Enterprise.
-The USS Pegasus, which had an interphasic cloaking device that not only hid ships, but also allowed them to move through solid matter. The ship had an accident with the device, and was "fused" with an asteroid.
-In the final episode of The Next Generation, a possible future had the Enterprise D equipped with a cloaking device. This seemed to be common in this timeline however, as the Romulan Empire was no more, making the Treaty of Algeron obsolete. This timeline proved to be incorrect when the Enterprise-D was destroyed in Generations.
-The USS Defiant had a cloaking device that was loaned to Starfleet by the Romulan Empire. The main stipulation of the loan was that it was not to be used in the Alpha Quadrant (a stipulation broken on various occasions). This ship was lost in the Second Battle of Chintoka. It is unclear if the second ship named the Defiant in Deep Space Nine also had a cloaking device; the ship was only in a couple of episodes, and it was never shown cloaked.
-The minefield set up around the Bajoran Wormhole during the Dominion War utilized cloaking technology. Though mines are not classified as ships, it is a point of interest in the use of cloak by the Federation.
-In the movie Insurrection, the Federation employed a Holodeck ship that was cloaked at least while on the surface of the planet. Also in the movie, we see cloaking suits, which individual personnel wore to go unnoticed.