The Cult of the Heretic were a religious group dedicated to worshipping the renegade Time Lord known as the Heretic. Their goal was to regenerate the universe to become its new rulers. Although they worshipped a Time Lord, none of the cult members were Gallifreyan.
The cult was started by the Heretic, who used the cult to construct an anomaly cage. The Doctor stopped the cult from using the Heretic's biodata to regenerate the universe and the Heretic was taken by the Time Lords.
Needing another Time Lord to activate the restart the universe, the cult made a deal with the Master, who had come to offer them his DNA in return for a position of power in their recreated universe. They manipulated him into coming into contact with his past self, claiming that they wanted him to kill his past self to prove his dedication to their cause. After the Master had crippled his past self, the Cult betrayed the Master by knocking out the future Master and transferring the past Master into his future self, leaving the older Master's mind in his past self. The act of having a Time Lord inhabiting the body of his past self led to the universe beginning to break down. The cult convinced the younger Master that he had just been transferred into the body of his attacker- not identifying the attacker as his future self- and allowed the younger Master to depart. The past-in-future Master returned to his old prison and used a 'mind leech' he had lured to the prison as part of an old plan to escape to try and restore his damaged mind, but although he was able to lure the Sixth Doctor into his trap, the Doctor was able to make a deal with the leech where it would only take his recent memories to restore the Master's mind, rather than taking his entire mind. (AUDIO: Vampire of the Mind)
The Cult had intended to kill the older Master directly, but when he escaped their captivity, they hired the Transhuman Sisters of the Unholy Protocol and the Dragonhunters to kill the older Master; while the paradox would still damage the universe as the two Masters travelled around in each other's bodies, the death of the future-in-past Master would ensure that the damage was irreparable. After a period trapped in the 1980s, to the point where he spent twenty years trapped as a disembodied mind in his own TARDIS, the future-in-past Master was able to restore his body and escape after a confrontation with the Fifth Doctor. (AUDIO: And You Will Obey Me)
The Seventh Doctor encountered both of the Masters and convinced them to return to their own bodies, although by this point the damage they had caused to space-time had become irrevocable. Leaving the Doctor on a spaceship that was about to crash, the two Masters then stole the Doctor's TARDIS and returned to the Cult's headquarters, where they killed all of the members. They planned to use the anomaly cage to recreate the universe, but were stopped by the Seventh Doctor- who escaped the crash in the Master's TARDIS, ironically using weapons that the Masters had used earlier and forgotten to reclaim from the Doctor- who made sure that the universe remained practically unchanged by its regeneration, his only change being to save the life of his temporary companion Jemima so that she was never killed by the Master. (AUDIO: The Two Masters)