Hamburg, who were relegated in 2018, failed to win promotion from Germany's second division for the second successive year following an embarrassing 5-1 thumping at home to mid-table Sandhausen last Sunday on the final day of the season.
"We have achieved a lot in the past season, but we did not reach the goal we had set ourselves. I take responsibility for this", said Hecking in a statement on Saturday.
By mutual consent, six-time German champions Hamburg will not extend Hecking's contract, which expired when the season finished last weekend. Following Hamburg's slip-up against Sandhausen, Heidenheim finished third in the second tier despite losing 3-0 at champions Bielefeld, who are promoted to the Bundesliga alongside Stuttgart.
Heidenheim held Bundesliga side Bremen to a goalless draw in Thursday's first leg of the relegation/promotion play-off. The return leg is on Monday with the winner playing in the top flight next season.
Ex-Hamburg striker Andre Breitenreiter, 46, who coached Schalke 04, Hanover and Paderborn in the Bundesliga, is a candidate to replace Hecking, who won the German Cup with Wolfsburg in 2015, when he was voted German manager of the year.