The New Zealand Rugby Union had opened the job up for applications as the Blues lurched through a terrible Super Rugby season to miss the play-offs and finish 12th in the 15-team southern hemisphere provincial competition.
"This is an exciting time. I am honoured to be given the opportunity to lead the Blues next season in what I hope will be a new era of success and innovation," Kirwan said.
"I'm also thrilled about coming back to New Zealand and home to Auckland after several years overseas.
"I am a proud Blues man and I started my rugby career in the region so I am really excited about connecting with fans and working with the Blues community.
"There is certainly some hard work ahead and I am looking forward to the challenge."
The Blues struggled with injuries and form this season, with Lam forced to field a number of up-and-coming players towards the end of the regular season.
"We've had to find a lot of young guys and I take my hat off to them, it's been a really tough season, we've had so much crap thrown at us," the former Samoa captain said after the Blues' final match on Saturday, an upset win over the Canberra-based ACT Brumbies.
"We're the most under-resourced coaching team in this competition with just two full-time coaches. Whoever takes this job next year, they need to be well resourced."
Lam re-applied for the job and had his interview last week, delaying his arrival in Australia ahead of the Brumbies match.
Kirwan, who played 142 games for the Auckland provincial side before he went to rugby league in the twilight of his career, was an assistant coach for the Blues in 2001 before he went overseas and coached Italy team from 2002-05.
He was credited with laying the foundation for former Springboks coach Nick Mallett to build on and turn the Italians into a more consistent international side.
Kirwan then coached the Japan team from 2007-2011, and guided them to their first Pacific Nations Cup title last year.
He left the team after last year's World Cup in New Zealand and was tentatively linked with vacant provincial jobs in his homeland after indicating that he was keen on one day coaching the All Blacks.
Kirwan was an apprentice butcher when he was plucked from the third division of Auckland club rugby by then provincial coach John Hart, and made his international debut in 1984.
He was rated one of the players of the tournament at the 1987 World Cup, and remembered for scoring a brilliant individual try against Italy in the opening game and making a crunching cover tackle in the corner during the All Blacks' semi-final victory over Wales.
He also scored one of the All Blacks' three tries in their 29-9 victory over France in the final.
Kirwan received a knighthood from the New Zealand government earlier this year for his services to sport and mental health after he spoke out about battling depression all of his life.