(covers information from several alternate timelines)
Starfleet Medical was a branch of Starfleet dedicated to the medical needs of its personnel and biomedical research. Based out of San Francisco on Earth, Starfleet Medical oversaw all Starfleet medical personnel and facilities.
From the mid-2150s onward, the department carried as its emblem a stylized version of the double-snaked medical caduceus symbol from ancient Greek mythology — a practice of the original Earth Starfleet carried over to unified Federation crews after the UFP founding in 2161. The symbol can be seen aboard the United Earth-era NX-class sickbay, prominently featured on the transparent access doors to sickbay (ENT: "Broken Bow", "Regeneration"), something repeated two centuries later with the Galaxy-class. (TNG: "Remember Me") Starfleet Medical also provided medical supplies for freighters of the Earth Cargo Service. (ENT: "Fortunate Son")
In the 2260s (when the emblem was replaced for a first time with a variant design), 2270s (when the original emblem was reintroduced) and the 2280s (which saw another briefly used design variant), the emblem was worn by starship medical personnel on their garments when on duty in sickbay. (TOS: "Where No Man Has Gone Before"; Star Trek: The Motion Picture; Star Trek II: The Wrath of Khan)
Starfleet Medical was a branch of Starfleet, though given some authorities over other sub-divisions in certain circumstances.
At least one medical frigate, the USS Hiawatha, was operated by Starfleet Medical in the 23rd century as indicated by the emblem on the primary hull and its ubiquitous presence in the holding bay. The ship was presumed lost in 2256, during the Federation-Klingon War, but its wreckage was located by accident by USS Discovery, and some Hiawatha survivors were subsequently rescued. (DIS: "Brother")
In one alternate timeline as well, Starfleet Medical was known to operate at least one other hospital ship of its own as well, the USS Pasteur, as indicated by its emblems on the primary hull and their prominent presence on the bridge. It too was destroyed by the Klingons in 2395. (TNG: "All Good Things...")
Starfleet Medical was known to have conducted "ESP" tests on Starfleet officers in order to ascertain such abilities within its officer corps. Two officers found with high scores had been Elizabeth Dehner and Gary Mitchell. (TOS: "Where No Man Has Gone Before")
Assistant Federation Commissioner Nancy Hedford blamed not having received the proper inoculations prior to her having contracted Sakuro's Disease, during her mission to Epsilon Canaris III in 2268, on "the inefficiency of the medical branch of the Starfleet." (TOS: "Metamorphosis")
In the 23rd century, an office existed known as the Starfleet Medical Surgeon General which held some command authority over Starfleet Medical, including the power to relieve starship medical officers for incompetence. (TOS: "Turnabout Intruder"; DS9: "The Quickening")
Starfleet Medical also owns and administers the Starfleet Medical Academy to which any Federation member can submit applicants.
In another alternate timeline, Starfleet Medical maintained at least one major Starfleet Medical Facility in the city of San Francisco, with one of its main buildings being called the "Starfleet Medical Center" in 2404. (VOY: "Endgame")
Starfleet Medical maintained many diagnostic and treatment wards, utilizing the most advanced technologies in the Federation. Long-term facilities were available to care for seriously ill patients. (VOY: "Endgame")
It was also responsible for all medical research activities in the Federation. Researchers were required to obtain approval from Starfleet Medical before proceeding with new treatments and medications. (TNG: "Ethics")
As a subsidiary division of Starfleet, Starfleet Medical is subject to their General Orders and Regulations and several of those are specifically directed at the division, including,
- Regulation 121 (Section A): The chief medical officer has the power to relieve an officer or crewman of his or her duties (including one of superior rank) if, in the CMO's professional judgment, the individual is medically unfit, compromised by an alien intelligence (TNG: "Lonely Among Us"), or otherwise exhibits behavior that indicates seriously impaired judgment. A Starfleet officer can face court martial for failing to submit to such a relief. (VOY: "Year of Hell, Part II")
- Unnumbered protocol: A physician must be present when administering arithrazine. (VOY: "The Omega Directive")
In 2151, the Klingon courier Klaang was brought to Starfleet Medical after being shot with a plasma rifle while on Earth. There, he was treated by Doctor Phlox, who had been stationed at Starfleet Medical through the Interspecies Medical Exchange. Captain Archer subsequently asked Phlox to join his crew as the chief medical officer aboard Enterprise NX-01. (ENT: "Broken Bow")
In 2369, Doctor Julian Bashir told a Bajoran woman he dated in the Replimat about his exam at Starfleet Medical. (DS9: "Q-Less") Shortly thereafter, he told Major Kira Nerys that he learned, in his first year at the medical school, never to trust a tricorder. (DS9: "The Passenger")
Odo visited Starfleet Medical in 2372, where they performed medical tests on him to gain information that could be used against the Founders. It was during this examination that Odo was infected with a morphogenic virus by the covert intelligence group Section 31. (DS9: "When It Rains...")
Odo contracted the morphogenic virus in late 2375, a disease that had already begun killing the Founders of the Dominion. Starfleet Medical was unwilling to assist Julian Bashir in his research for a cure and refused him access to Odo's medical file, believing Bashir was trying to help the enemy. When Benjamin Sisko requested the file, they sent a copy of Mora Pol's medical file on Odo, taken decades previously, in an attempt to hinder Bashir's efforts. (DS9: "When It Rains...")
In an alternate timeline, in which it took the USS Voyager twenty-three years to return to Earth, Tuvok was sent to live at the Starfleet Medical Facility in San Francisco, having succumbed to a mental condition while aboard in 2378. He was treated for his affliction in the Starfleet Medical Center building. The holographic doctor of Voyager was working at the medical facility in 2404 and was helping Tuvok, as well as working on the project to develop chronexaline. (VOY: "Endgame")
The Starfleet Medical Center building, featured in the final Voyager two-part episode "Endgame" is based on an existing real world medical center. Shown is an in post-production edited image of one of the buildings on the "Kaiser Permanente Baldwin Park Medical Center" complex, located at 1011 Baldwin Park Blvd. Baldwin Park, California 91706. For its Star Trek appearance, a globe statue was added in post-production in the pond in front of the building, aside from the Starfleet Medical signage on the building. Commissioned by the non-profit health consortium Kaiser Permanente, the futuristic looking real world complex was designed by Canadian architect Arthur Erickson , and opened in 1988, thirteen years before the Voyager episode aired. 
Its appearance in the Voyager episode seems to have been overlooked by the otherwise meticulous author couple Mike and Denise Okuda, neither the building has received an entry in the 2016 fourth edition of the Star Trek Encyclopedia, nor has Starfleet Medical for that matter, a bit surprisingly perhaps in the latter case.
A plethora of Starfleet Medical related production assets, both props and insignia, was auctioned off after Star Trek prime temporarily ceased production in 2005, in auctions such as 40 Years of Star Trek: The Collection, It's A Wrap! sale and auction, and the various auctions of Profiles in History and Propworx. A far from exhaustive listing of these items, can be found in The Star Trek Auction Listings archive.
The very first medical caduceus symbol was seen in two episodes of Star Trek: The Original Series on the sickbay garments of Dr. Mark Piper and bedridden patients (Gary Mitchell and Khan Noonien Singh), and consisted of two snakes wrapped around an elongated Starfleet arrowhead surrounded by a wreath. (TOS: "Where No Man Has Gone Before", "Space Seed")
The second, more stylized, medical caduceus symbol was designed by Lee Cole and Rick Sternbach, the graphic designers for Star Trek: The Motion Picture and was seen as badges on garments of medical personnel on duty in sickbay. For Star Trek II: The Wrath of Khan, Cole came up with a more artful variant which was now worn as a pin instead as a badge, and was only featured in this production.
Cole's successor for the modern television franchise, Scenic Artist Mike Okuda, co-author ot the aforementioned Encyclopedia, adopted their original design, and the symbol was most frequently seen throughout the entire run of the modern television franchise on the new medkits, introduced during the first season of Star Trek: The Next Generation. ("The Arsenal of Freedom") Okuda also retconned the symbol as signage throughout the sickbay of the Enterprise NX-01 in Star Trek: Enterprise, thereby canonically establishing that the symbol had been in use for over two centuries, being adopted for Star Trek: Discovery as well. (ENT: "Broken Bow", "Dear Doctor"; ST: "Calypso"; DIS: "Brother") Strictly speaking, the introduction of the Cole designed symbol in Discovery, meant that it, from an in-universe point of view, must have had been replaced shortly thereafter by the original one, seen in the Original Series.
Yet, both Cole/Sternbach and Okuda, unwittingly perhaps, perpetuated the misconception, especially held in the United States, that the double serpent-entwined caduceus was the proper symbol for medicine and healing, which it was not. The proper symbol has traditionally been the Rod of Asclepius, a single serpent-entwined rod, lacking the wings, wielded by Asclepius, in Greek mythology the god of healing and medicine. The caduceus on the other hand, was the rod carried by Hermes, the god of travelers, commerce and thieves, and his rod has since then become the symbol of commerce. Hermes was concurrently the messenger of the gods, and was therefore often depicted with wings on his helmet and sandals, indicative of speedy delivery, hence the wings on his rod.
The proper symbol was on at least three occasions featured in a Star Trek production; On Doctor Leonard McCoy's SS uniform as a left sleeve patch in the Star Trek: The Original Series second season episode "Patterns of Force", and as a slip-over lapel on the shoulder strap of the uniform of a Beta Hirogen SS medic in Star Trek: Voyager's fourth season episode "The Killing Game, Part II". In a somewhat artistic interpretation, the proper symbol was also seen as the symbol representing the advanced medical science technology of the Aquans in the Star Trek: The Animated Series episode "The Ambergris Element".
For unclear reasons, the misconception originated in the United States when the caduceus was introduced shortly before the American Civil War as the symbol for the US Medical Corps. Surviving Civil War uniforms of the Union Medical Corps show the symbol embroided on a green band, worn as a chevron on both sleeves. (Echoes of Glory: Arms and Equipment of the Union, Time-Life Books, 1991, pp. 158-159) Incidentally, the color green – since the Middle Ages traditionally associated with nature and life,  and thus by inference with medicine and to this day the color for pharmacy, first aid, and animal care in the western world – was adhered to in the first six Star Trek films as the color signifying medical divisions, shown in the fields of their personnel's insignia as well as being the color of their undershirts, before returning to the various shades of blue, the generic color signifying all sciences divisions, as already established in The Original Series.
The misconception was perpetuated for nearly a century in the US armed forces until the interbellum years, when the medical branches of the US Airforce  and the US Navy  started to carry the proper symbol on their coat of arms. And while the US Army Medical Department (as have US civilian medical institutions) has followed suit for its coat of arms, the armed forces chose to continue the usage of the caduceus for their individual (regimental) badges and insignia, as could be seen on the uniform of USAAF nurse Garland in the Star Trek: Deep Space Nine season four episode "Little Green Men". It was because of its continued use by the armed forces that the moniker "caduceus" has been augmented in parlance to "medical caduceus" to indicate its use as the latter.
Cole's original design, which has never gained formal real world recognition, has to some extent been adopted by other Hollywood productions, as at least one long running television show, the CBS Studios crime series NCIS, is known to have adopted the symbol on its featured ambulance as well.  In reality, the by far most utilized symbol on ambulances in the USA, is the blue (or on rarer occasions red – predominantly by government institutions – or green, as explained above) six-pointed Star of Life, featuring the proper Rod of Asclepius in its center.