Were the Clones/Stormtroopers loyal to the head of the galaxy at the time or just to Emperor Palpatine? Whose side did they join after the empire fell?
None of this is canon any more, unfortunately, and could change with the new Disney films. But according to the Star Wars Expanded Universe, most of the Imperial Army, which includes stormtroopers, stayed loyal to whoever was in charge of the empire. Very few of them seem to have defected to the New Republic, which was the successor-state to the Rebel Alliance. Some of them stayed loyal to the individual worlds or ships they were stationed on, when the Imperial Navy split into warring factions supporting different warlords. This gave some of the larger warlords, such as Admiral Daala, control over a stormtrooper army of a sort, but nothing compared to the army controlled by whoever was in charge of the Empire at the time.
The Imperial government was itself quite volatile, with many changes in leadership, until it achieved a degree of stability under Grand Admiral Thrawn, only to fracture again after his death. Eventually, 15 years after Palpatine's death, the last eight surviving Moffs granted Thrawn's protege, Supreme Commander Pellaeon, permission to sign a peace treaty with the New Republic. Previous legislation by Leia Organa Solo had prevented former stormtroopers from holding office in the New Republic, but it is unclear if this law stood after the Pellaeon-Gavrisom Treaty.
There is no fully canon answer until the release of Episode VII, which will presumably provide some information about the stormtroopers' fate.
In Legends, stormtroopers were allied with the Imperial Remnant after the death of Emperor Palpatine and the fall of the Galactic Empire. Although the Empire was defeated at the Battle of Endor, substantial Imperial forces remained elsewhere in the galaxy. The Imperial Remnant largely continued to fight the Rebel Alliance (which turned into the New Republic) but even found themselves fighting alongside the New Republic and its successor states during the Yuuzhan Vong War to repel the extra-galactic invaders. Eventually the stormtroopers became affiliated with the Fel Empire.
Also, the recently updated canon states that the stormtroopers were not clones.