In 1998, we got an SPD/Greens coalition government (with SPD being left-ish). The Green party formed in the late 1980s from various ecological initiatives, among them groups that protested against the use of nuclear power as an energy source.

Therefore quitting nuclear power was part of that government's DNA.

2002:

In 2000 they managed to create an accord on ending the use of nuclear power plants, signed by the various affected parties in 2001 and turned into law in 2002.

The law forbade the creation of new nuclear power plants (not that it mattered much: the last one went online in 1989), set a limit of "an average of 32 years of operation" for existing sites, and that there may be a total energy production of 2.62 million GWh through nuclear power in Germany, counting from January 1, 2000.

By December 31, 2008 a good half of that amount was generated.

There were some other new requirements as part of the 2002 law: regular safety controls, no nuclear reprocessing, a requirement to setup sites for temporary storage of nuclear waste, tenfold increase to 2.5bn EUR for the mandatory insurance operators had to take against incidents (with no limit in personal liability if they were at fault).

2010:

In 2009, Germany got a new management (CDU/FDP: Merkel's CDU, that we consider conservative, with the FDP as a highly fiscal conservative / corporation friendly side-kick).

They quickly drafted a new deal which went into effect in 2010:
The 7 oldest plants were granted 8 more years of operation each. The other 10 plants got 14 more years. But still no permits for new plants. (so enthusiasm was... low)

Everybody else was checking various legal venues to stop the law from going into force.

2011:

Fukushima happens. In Germany, the highly contentious decision from yesteryear (still hotly debated) meets the fears of a nuclear wasteland.

Within days the 7 oldest plants that were just granted 8 more years (plus a newer one that was notoriously problematic) were ordered to shut down for a few months until things are sorted out.

Within 5 months, there was another revision of the law on nuclear power, which required those 8 plants to remain shut down.
It also defined various lifetimes for the other plants, none staying in operation into 2023.

The first of the remaining sites went offline recently, for the others there's a map with their schedule at http://www.bmub.bund.de/themen/atomenergie-strahlenschutz/nu...

End result:
The latest plants went online in 1989, so for them the "average 32 years life time" would have been in 2021. Since various older plants were running longer than their 32 years, 2021 would be a good guess, if a bit on the high end.

However assuming that power generation in nuclear power plants is somewhat constant over the years, with some reduction over time due to plants shutting down, these 2.62 million GWh might have lasted until 2018 or so.

Merkel is now held responsible for "shutting down nuclear power in Germany" by the end of 2022. Which, to me, looks like an extensions, not a restriction of nuclear power in Germany.

(Details taken from https://de.wikipedia.org/wiki/Atomkonsens and https://de.wikipedia.org/wiki/Atomgesetz_(Deutschland) )