Artificial gravity was a group of systems designed to mimic the gravity of a planet in an artificial environment, such as on starships and space stations, to allow working to be easier for those accustomed to a gravity environment.
When building the generational worldship Yonada the Fabrini Creators used a collapsed matter core to give the ship sufficient gravity. They created this core by collapsing an asteroid with shaped antimatter charges. Then they bombarded the core with carbon in order to build a thick diamond shell around the core, and built the ship over this core. This was by considered by Federation science a dangerous way to achieve artificial gravity, however it was the best technology available to the Fabrini at the time. (TOS novel: Ex Machina)
In 2254 the USS Enterprise used a photon torpedo volley to disable the artificial gravity of the USS Cortez which had been attacking the Enterprise. The resulting disruption for the Cortez's crew gave the Enterprise's crew some time to conduct repairs. (EV comic: "Cloak and Dagger, Part 2 of 2")
Following an attack in 2293, the artificial gravity systems aboard the Klingon vessel, Kronos One, failed. This resulted in the crew experiencing weightlessness until the systems were restored, unfortunately assassins used this opportunity to beam aboard and assassinate Chancellor Gorkon. (TOS movie: Star Trek VI: The Undiscovered Country)
In 2370, Miles O'Brien deactivated the artificial gravity in a section of Deep Space 9 occupied by a group of hungry Horta to try and slow their progress to DS9's core. The tactic was successful for a short time but the Horta panicked and sprayed acid which caused damage to the surrounding area resulting in a radiation leak which forced O'Brien to reinstate the gravity before any more damage was done to that section. (DS9 novel: Devil in the Sky)