The blessing of Baruch Shepitarani:
The father of a Bar Mitzvah boy recites the blessing of Baruch Shepitarani after his son becomes Bar Mitzvah [after the first Aliyah after his Bar Mitzvah, as will be explained below].
The reason for the blessing: The reason behind why this blessing is said is because until this point the son would receive punishment due to the sins of the father, [and this would likewise cause the father that get punished for causing punishment to his son]. Hence, he recites a blessing that from now onwards the punishment for his sins will no longer be meted out to his son. Alternatively, the reason for this blessing is because until this point the father was obligated to educate his son in Mitzvos, and he would get punished if his son sinned due to lack of education, and he is now exempt from this Mitzvah.
When? Some Poskim rule the blessing is to be said on Shabbos, upon the Bar Mitzvah boy getting his first Aliyah, when it becomes known to all that he is now Bar Mitzvah. Practically, however, the blessing is recited whenever the Aliyah takes place, whether on Monday, Thursday, Rosh Chodesh, or Shabbos, and so is the Chabad custom. [Accordingly, the father is to go up with his son by his first Aliyah and recite the blessing after its conclusion. If the blessing was not said at that time, then the blessing may be said any time afterwards. It may be said even not by the time of an Aliyah. Although those who say it with a blessing should only do so within thirty days of the Bar Mitzvah.]
Is the blessing said with Hashem’s name? Some Poskim rule that the blessing is said with Hashem’s name [even if the father does not know if his child has grown two hairs]. Other Poskim, however, rule that it is said without Hashem’s name, and so is the widespread custom of the world, and so is the Chabad custom. So is likewise the Sephardi custom. [One is not to answer Amen to the blessing when it is said without Hashem’s name.]
After Kaddish: If the Bar Mitzvah boys receiving his Aliyah on Monday or Thursday, then the blessing of Baruch Shepitarani is to be recited after the half Kaddish.
The Chabad custom is for the father to recite the blessing of Baruch Shepitarani Meionesh HaleZeh immediately after the first Aliyah of his son to the Torah, on the day of, or in close approximation to his Bar Mitzvah. On Mondays and Thursdays, it is recited after the Kaddish.
 Rama 225:2; Midrash Raba Toldos 63; Maharil Hilchos Kerias Hatorah, in name of Mordechai; See Ben Ish Chai Reih 1:17; Ketzos Hashulchan 65:6; Piskeiy Teshuvos 225:4-6; Siddur Raskin footnote 87; Nitei Gavriel Chapter 12; Omitted from Rambam, Tur, Michaber, see Mishneh Torah Kapach Mada p. 629 footnote 7 that for this reason Yemenite Jewry is not accustomed to say it
Custom of Alter Rebbe by the Bar Mitzvah of his son the Mittler Rebbe: The Alter Rebbe received an Aliyah by Shelishi of Thursday, which was the day of the Bar Mitzvah, and said the blessing of Baruch Shepatrani with Hashem’s name.
 See M”A 225:5; Levush 225; Shaareiy Efraim 4:26; Ketzos Hashulchan ibid footnote 13 in length; Nitei Gavriel 12:7
 Machatzis Hashekel on M”A ibid; Shaareiy Efraim ibid
 Levush ibid, brought as 2nd Pirush in M”A ibid
 1st Pirush in M”A ibid
 M”A 225:4; See Piskeiy Teshuvos 225 footnote 39
 Aruch Hashulchan 225:4; Hayom Yom 12th Kisleiv; Sefer Haminhagim p. 74; Igros Kodesh 7:228; Shulchan Menachem 1:263; Piskeiy Teshuvos 225:6; Nitei Gavriel 12:9; See Likkutei Dibburim ibid that the Alter Rebbe recited it on Thursday, even though the Aliyah was on Shabbos! See Nitei Gavriel 12:14
 Shaar Efraim 4:25
 See Ketzos Hashulchan ibid footnote 14
 Nitei Gavriel 12:17; See Rama ibid who simply writes “after his Bar Mitzvah” and does not depend it on an Aliyah; See Ben Ish Chaiy ibid who writes even initially to say it by the celebratory meal
 Betzel Hachochma 5:132; Nitei Gavriel 12:8
 See Ketzos Hashulchan ibid footnote 13; Piskeiy Teshuvos 225:5; Nitei Gavriel Bar Mitzvah p. 100
 1st opinion in Rama 225:2; Siddur Admur as edited by the Maharil writes it with Hashem’s name [See Shaar Hakolel 24; Siddur Raskin ibid]; Migaleh Amukos Toldos; Maharil Hilchos Kerias Hatorah in name of Mordechai; Tashbeitz 390; Gr”a; Chayeh Adam 65:6; Shaareiy Efraim 4:25; Kitzur SHU”A 61:8; Aruch Hashulchan 225:4; M”B 225:8 that one who says the blessing “Lo Hifsid”; See Chasan Sofer 96; Piskeiy Teshuvos 225:5 footnote 36; Kuntrus Hassidur p. 375 footnote 3; Poskim in Nitei Gavriel 12 footnote 4
 Ketzos Hashulchan 65 footnote 13
 Rama 225:2 that “It is good to say it without Sheim Umalchus”; Midrash Raba ibid writes it without Hashem’s name; Lechem Chamudos 4; Levush 225; Elya Raba 225:5; Derech Hachaim; Siddur Yaavetz; Ledavid Emes 6:79; Ben Ish Chaiy Re’eh 1:17; Aruch Hashulchan 225:4; Birchas Habayis 31; Kaf Hachaim 225:16; Piskeiy Teshuvos 225:5 footnote 37; Poskim in Nitei Gavriel 12 footnote 7
 The reason: As the blessing is not mentioned in the Talmud or Poskim. [Darkei Moshe 225]
 Hayom Yom 12th Kisleiv; Igros Kodesh 7:228; Shulchan Menachem 1:263; Ketzos Hashulchan ibid footnote 13 that so is the Chabad custom that he has seen; See Hiskashrus 435 p. 12; Siddur of Rav Raskin
The custom of the Chabad Rabbeim: The Chabad Rabbeim were accustomed to reciting this blessing with Hashem’s name. [Sichas 5696 p. 89 that so did the Alter Rebbe; Likkutei Dibburim p. 351 Hebrew] This was not a directive to the public. [Rebbe in Igros Kodesh ibid in name of the Rebbe Rayatz] See Hilchos Vehalichos Bar Mitzvah p. 78
 Ben Ish Chaiy ibid writes to think Hashem’s name in ones mind
 Betzeil Hachochmah 5:90
 Rama ibid; Midrash Raba ibid; Yaavetz in Luach Eres 328; See Leket Yosehr who writes that the Terumas Hadesehn said it in Aramaic
 Siddur Admur; Ketzos Hashulchan ibid footnote 13 that this Nussach was written by the Maharil and was most certainly what he heard from Admur; See Siddur of Rav Raskin ibid and Nittei Gavriel 12 footnote 3
 Nitei Gavriel 12:10