When the Autobot contingent led by Fortress Maximus arrived from Nebulos to Earth, they sought contact with the Autobots of Earth, who were aboard the Ark, led at that point by the Dinobot Grimlock. Instead of marshaling their forces, their first meeting degenerated into a duel over leadership under the Autobot Code of Combat, with the Moon picked as a neutral location. As Grimlock faced off against the injured Fortress Maximus's proxy, Blaster, the Ratbat-led Decepticons ambushed the Autobots. While the combined efforts of the Autobots allowed them to defeat their attackers, the Ark was crippled, and with the Steelhaven having left to rebuild Optimus Prime, both groups were trapped on Earth's satellite.
In a bout of extreme
emo-ness depression brought on by the death of Ratchet, Optimus Prime ordered the Ark landed on the Moon to allow him walk and brood alone there.
The Transformers cartoon
In an attempt to hijack Earth's airwaves and cripple the humans' ability to communicate with each other, Megatron had a base built on the Moon. After Blaster and Cosmos were captured, Blaster sent music over Megatron's transmissions to let the Autobots learn where they were. After driving off the Decepticons, Blaster commandeered the base to use it to hang.
Later, the Autobots and the Decepticons were fighting on the Moon when a mysterious voice summoned Sky Lynx, Trypticon, the Dinobots, the Predacons, the Terrorcons, and the animal-form cassettes to battle Tornadron.
Beast Wars cartoon
The Mini-Con ship, the Exodus, crash-landed on the Moon, scattering its stasis-locked passengers all over Earth. Later, the Decepticons would set up a base inside the derelict ship, from where they would teleport to various locations on Earth to search for the Mini-Cons.
Alexis, Carlos and Rad would later end up on the Moon when they were accidentally teleported there during a fight. Apparently, by 2010, the Moon has a breathable atmosphere but no other alterations or terraforming, as the kids are able to move about and talk, despite the fact that they should have asphyxiated within minutes.
Ten years later, the Autobots and humans had established an energon mining base on the Moon's surface, creatively named Lunar City. They assigned Cyclonus and Tidal Wave to guard it. This lasted right up until someone actually attacked it.
When he was being stalked by a mysterious invisible assassin, Optimus Prime went to the moon to lure his attacker out into the open and challenge him directly.
Kicker eventually realized that there was still energon -- and survivors -- in the ruins of Lunar City, leading to the Autobots returning there. They built a new energon tower to protect the resurgent base.
Inferno used Lunar City's repaired and upgraded defenses to blast the three artificial "comets" that Megatron sent to destroy Earth. It didn't seem to help much.
The Moon was later used as the launching point for the starship Miranda II.
The Mini-Con ship crashed on the Moon, leaving half of it and many of its occupants trapped there. Dualor took control and organised them into a community—a very well-armed community who were not allowed to leave—and declared they had to defend themselves against both Autobot and Decepticon exploitation. When Dualor abducted Earth's Mini-Cons "for their own good," both Autobot and Decepticon attentions were drawn to the Moon. This led to the Moon base's eventual destruction and evacuation.
Live-action film series
In an alternate reality where Megatron took control of the All Spark, the Autobot reinforcements for Earth (all six of them) arrived on the moon to avoid Decepticon detection and await orders. Pity the Decepticons detected them really soon, eh?
After a run-in with the Bermuda triangle, Soundwave retreats to the Moon, as he feels it's much safer than Earth.
Dark of the Moon
The dark side of the Moon was the final resting place of the Ark. After being shot while trying to flee Cybertron, it eventually crash landed on the Moon. The humans on the nearby planet noticed the impact and subsequently sent a mission to the Moon to investigate.
When Starscream discovered the AllSpark on Earth, he apparently crashlanded the Nemesis on its moon and continued to the planet's surface by other means. The vessel was later discovered by a human remote-control space rover, which was promptly stomped by Lugnut when he and Blitzwing landed near the Nemesis during their search for Megatron. The two Decepticons then proceeded to Earth.
The wreckage of the Nemesis was later used as Starscream's base of operations as he cloned himself. Once he deemed his troops sufficient, he again departed from the moon with the clones in tow.