Gatland was under contract to New Zealand Rugby until the end of next year, but he said the offer from Wales was too hard to turn down.
Gatland, 59, told a press conference in Wales that he was aware of what the expectations would be for him in accepting the position and that he was putting the legacy of his earlier stint as coach on the line.
When first approached, he talked it through with his family before agreeing to take the role.
"I know it's a pressure job, but the buzz of rugby and being involved in the Six Nations and World Cup was the tempting factor.
"I loved my time here and I wouldn't have stayed as long if I hadn't been so well-received.
"We had some success, but also some disappointment. I hope I can create an environment where we can service the expectations of the public."
In his first stint as Wales coach, from 2007-2019, Wales won four Six Nations titles and three grand slams and made the semifinals of the 2011 and 2015 Rugby World Cups. He also coached the British & Irish Lions to a series win over Australia in 2013, a drawn series with New Zealand in 2017 and a lost series in South Africa in 2021.
At the start of the conference Gatland acknowledged out-going coach Wayne Pivac.
"Before I say anything I want to recognise the human side of this. Wayne departing must have been tough and my thoughts go out to him and his family. I think it is important that and him being a good man with really good values."
Pivac had said earlier that he was extremely sad to stand down from the role.
"Unfortunately, the results or performances this year were not all as we hoped. As a group we all take responsibility for that, but me in particular as head coach."
Gatland, who will be back in Wales before Christmas, said there was little time for sentiment about his role.
"Our immediate priority is obviously the 2023 Six Nations and next year's Rugby World Cup. There is little time for sentiment. Professional sport is all about preparation, values and results.
"There will be new challenges, as there always are with a change in head coach, but for me, the environment, the players and their families will always come first.
"We must prepare to the best of our ability in the time available. We will value and respect each other, we will work hard and, if we get this right together, performances and results will follow."
Wales has also said there is an ability in Gatland's contract for him to continue until the 2027 Rugby World Cup.