Former India captain Sourav Ganguly has retired from all forms of cricket after deciding not to play in the Indian Premier League next season.