The name Sakka bore in a previous birth when he was born as a man in Macalagáma in Magadha.
The usual form of the name is a derivative - e.g., J.vi.212; he is often called Maghavá Sujampati - e.g., J.iii.146; iv.403; v.137, 139; vi.102, 481, 573; or Maghavá Sakko - e.g., J.v.141; see also Mtu.i.165, 167 (sahasranetro Maghaván va sobhase) and Mtu.iii.366 (Sakro áha: Maghaván ti me áhu syaloke).
His story is given in the Kulávaka Játaka. For a slightly different version see DhA.i.264ff. Because of his birth as Magha, Sakka came to be known as Maghavá. Maghavá was, perhaps, not the personal name of any particular Sakka, but a title of all Sakkas, because the Sakka who was the real Magha is identified with the Bodhisatta (J.i.207), while the Buddha says (S.i.231; DhA.i.264) that the Sakka, who visited him, and whose conversation is recorded in the Sakkapańha Sutta, was also known as Maghavá. The title probably originated from the time when Magha became Sakka.
The Samyutta Commentary (SA.i.267; this is supported by the story as given in DA.iii.710 ff. and DhA.i.264ff., where no mention is made of the Bodhisatta), however, says that Magha was not the Bodhistatta, but that his life was like that of a Bodhisatta (Bodhisattacariyá viyassa cariyá ahosi); in which case the name Maghavá belongs only to the present Sakka. Magha took upon himself seven vows (vatapadáni), which brought him birth as Sakka: to maintain his parents, to revere his elders, to use gentle language, to utter no slander, to be free from avarice, to practise generosity and open handed liberality and kindness, to speak the truth, to be free from anger (S.i.227f.; SA.i.267).
For this and other titles of Sakka, see Sakka.