The 38-year-old, a World Twenty20 winner in 2014, took a record 107 T20 international wickets at 20.79 apiece.
He played only T20 internationals, having retired from Tests in 2011, one-day internationals in 2019 and franchise cricket this year.
Malinga thanked his former team-mates and the teams he has represented.
“I’ve had many experiences throughout my career, and I want to share all of my experience in the future, especially with young cricketers,” he said.
Malinga, who last played a T20 for Sri Lanka in March 2020, was left out of the squad for the T20 World Cup starting on 17 October.
Known for his slingy action and accurate yorkers, Malinga took 390 wickets at an average of 19.68 in 295 games in all T20 cricket – a tally bettered only by Dwayne Bravo, Imran Tahir and Sunil Narine.
That included 170 wickets in the Indian Premier League, where Malinga won the title with Mumbai Indians in 2013, 2015, 2017 and 2019.
Malinga, who made his international debut in 2004, is also Sri Lanka’s third highest wicket-taker in ODIs with 338.
He is the only bowler to take three hat-tricks in ODI cricket, and four wickets in four balls on two occasions.
He took 101 wickets at 33.15 in 30 Tests.