Politicians had called for his dismissal over the justice department's handling of FBI "terror investigations" and the firing of US federal prosecutors.
He also faced a possible perjury investigation for his testimony before congress.
Viviana Hurtado, Al Jazeera's correspondent in Washington DC, said: "From the start, President Bush's decision to choose Alberto Gonzales as US attorney-general, the government's top law officer, was divisive.
"Charged with shaping the legal limits of Bush's declared 'war on terror', Gonzales played a key role in several legal decisions that have shaped US security policy since September 2001."
According to a senior administration official who spoke on condition of anonymity, Gonzales, 51, will be temporarily replaced by Paul Clement, the solicitor-general, who will take over until a permanent replacement is found.
|"[Gonzales] argued for a new definition of what constitutes torture. Critics say this opened the door for abuse of prisoners in US custody"|
Al Jazeera's correspondent in Washington DC
Gonzales is the latest member of Bush's inner circle to leave the White House as the administration heads towards the final year of its two-term reign.
Karl Rove, a senior Bush adviser, departed last week, following Dan Bartlett, former communications director, earlier this year.
Gonzales worked for Bush when he was governor of Texas in the 1990s.
He served as White House lawyer in Bush's first term as president before becoming the first Hispanic attorney-general in February 2005.
Speaking in Waco, Texas, on Monday, Bush accused Gonzales' detractors of unfair treatment and dragging his name "through the mud".
He called Gonzales a man of integrity, decency and principle. He said he had been reluctant to accept the resignation, which came after "months of unfair treatment that has created a harmful distraction at the justice department".
Gonzales' predecessor, John Ashcroft, had resigned after falling ill amid speculation that he had fallen out of favour with the White House for not re-authorising a secret surveillance programme.
Hurtado reported that Gonzalez came under fire for expanding the administration's domestic surveillance programme and for helping to convince Bush to declare captured Taliban and al-Qaeda suspects 'enemy combatants' rather than 'prisoners of war'.
"That decision denied those held at Guantanamo and other US-run prisons of legal protections under US and international laws," she said.
"Separately, he argued for a new definition of what constitutes torture. Critics say this opened the door for abuse of prisoners in US custody."
While acknowledging mistakes in the handling of the dismissals, Gonzales had denied the firings were politically motivated to influence federal investigations involving Democratic or Republican legislators.