Question: When should we light our menora before and after Shabbos?
Answer: The Shulchan Aruch (OC 679:1) writes that as one accepts Shabbos by lighting the Shabbos candles, one must light the Chanuka candles first. The Magen Avraham (679:1) and Mishna Berura (679:1), however, point out that this isn’t necessarily the case with men who light Shabbos candles. The Rema adds that even though this means that they are lighting the menora before shekia, one still recites the berachos.
While the Magen Avraham (679:1) and Mishna Berura (679:2) write one can light the menora from plag hamincha, one and a quarter halachic hours before nacht, R’ Moshe Sternbuch (Moadim Uzemanim 2:152) writes that one should not light more than half an hour before shekia (See Igros Moshe OC 4:62).
The Mishna Berura (ibid.; Biur Halacha 672:1) writes that one must fill one’s menora with enough oil or large enough candles to last for half an hour after tzeis, nightfall.
The Mishna Berura (679:2) writes that ideally one should daven Mincha before lighting the menora. The Kaf Hachaim (OC 671:79) and R’ Ovadia Yosef (Yechave Daas 1:74) explain that the menora serves to remind us of the menora in the beis hamikdash which was lit after the afternoon korban tamid, now represented by Mincha. The Aruch Hashulchan (OC 671:26), however, writes that as we usually light Shabbos candles before Mincha, our minhag is to light the menora before Mincha, too.
The Rema (OC 681:2) writes that one should light the menora immediately after Shabbos, even before saying havdala.
The Taz (OC 681:2) and Mishna Berura (681:2) argue however, that we should recite havdala first, following the rule of tadir vesheino tadir, tadir kodem, the more regular of two mitzvos is performed first. The Aruch Hashulchan (OC 681:2) adds that it makes less sense to say the beracha of meorei haesh after one has already lit the menora. Additionally, even the Rema seems to imply that if one didn’t hear havdala in shul that one should say it first (See Yechave Daas 1:75; Shevet Halevi 6:85).
R’ Dovid Zvi Hoffman (Melamed Lehoyil 1:122) relates that while he used to always recite havdala first, he once lit the menora first as he was running out of time. Just before he was about to light, he realised that he had forgotten to say ata chonantanu, and so it was still Shabbos for him! He took this as a sign from heaven that he should not change his minhag.
In conclusion, one should light the menora on erev Shabbos shortly before lighting Shabbos candles. Unless one has a specific minhag otherwise, one should ideally recite havdala on Motzaei Shabbos first.