Kumar Sangakkara has quit as captain of Sri Lanka' one-day and Twenty20 sides just three days after their World Cup final defeat to India.