The former Wales international paid tribute to both Sir Alex Ferguson – his boss for all but one season of his 24-year professional career – and Van Gaal as “great managerial mentors”, and said it was a difficult decision to leave the club he joined as a 14-year-old in 1987.
“After 29 seasons at Manchester United as a player and assistant manager, I know winning is in the DNA of this club – giving youth a chance, and playing attacking and exciting football,” Giggs told United’s website.
“It’s healthy to have high expectations, it’s right to expect to win. Manchester United expects, deserves, nothing less.
“This is why it is a huge decision for me to step away from the club that has been my life since the age of 14. It has not been a decision that I have made lightly.
“I’ll take away so many special memories as well as a lifetime of experiences that will, I hope, serve me well in the future.”
Giggs, who hoped to take over as manager following Van Gaal’s sacking in May, backed new boss Jose Mourinho to be a success in the role.
“There are only a handful of proven winners at the very highest level and Jose is unquestionably one of them,” he said. “I know the fans will welcome him.”
Cardiff-born Giggs joined the United academy on his 14th birthday, turning professional aged 17 in November 1990 and making his first-team debut against Everton on 2 March, 1991.
He became a player-coach following the arrival of Moyes as manager in 2013, and had a brief spell as caretaker-manager following the Scot’s dismissal in April 2014, taking charge of the final four games of the season.
He served as assistant to Van Gaal for two seasons.
United pay tribute to Giggs
Manchester United executive vice-chairman Ed Woodward says Giggs’ “rigour and diligence” will help him become a successful manager in the future.
“The experiences and discipline he developed at United will undoubtedly be a big help as he continues to learn his trade,” he said. “He has all the attributes to be a terrific manager in the future.”
Manchester United midfielder Ander Herrera posted on Twitter: “It has been a great honour to learn from such a football legend like you. I wish you all the best.”
United vice-captain Michael Carrick posted a picture on Twitter of him holding the FA Cup with Giggs, and wrote: “Gonna miss this fella. All great things come to an end I suppose. He’s gonna make a top manager. Good luck mate.”
Dutch defender Daley Blind thanked Giggs on Twitter, writing: “I wish you all the best in the future, a Legend but also a great personality! Learned a lot Thanks #GiggsLegend”
Analysis: BBC Sport’s Simon Stone
Ryan Giggs might be leaving Manchester United after almost three glorious decades. But Giggs will hope to return one day. And most United fans will share that hope.
Having accepted it was too early to take the manager’s job after the experience of being in the hot-seat for four games following David Moyes’ dismissal, there is no doubt Giggs felt capable of replacing Louis van Gaal.
In an ideal world, Van Gaal would have seen out his three-year contract and Giggs would have taken over in a seamless transition. As recently as December, it was the future envisaged by senior figures in the United hierarchy.
But football is not an ideal world. Even though Giggs retained influential backers at Old Trafford, the club targeted Jose Mourinho as a potential replacement for Van Gaal as results and performances suffered in mid-season.
By the time the axe fell on Van Gaal in the wake of the FA Cup final win over Crystal Palace, Giggs knew the job would not be his.
And as a relatively late starter in management due to the staggering length of his playing career, there was no other decision to make other than to seek a fresh challenge.
Giggs will not be short of offers. But he needs to choose wisely. He cannot risk his reputation at a club where the sack will follow within weeks if immediate results are not the ones he – or his new employers – are looking for.
It is a moment he has prepared well for. His coaching badges are all done. As Giggs pointed out in his statement, he had two amazing managerial mentors in Sir Alex Ferguson and Louis van Gaal. Draw your own conclusions about the absence of David Moyes from the list.
Giggs had hoped he would stride confidently into the manager’s dugout at Old Trafford. Instead, he must do so elsewhere.
Subscribe to the BBC Sport newsletter to get our pick of news, features and video sent to your inbox.