The lights of the Menorah must burn for at least a half hour after nightfall. This is especially important to keep in mind on Friday afternoon when one lights the candles before candle lighting. Thus for example, in Baltimore this Friday, Shabbos candle lighting time is 4:26 PM and nightfall is 5:28 PM, so one’s candles should be able to last for a little over an hour and a half (from before 4:26 until 5:58 PM).
Even after the candles have burned for a half hour one should not extinguish them. However, if one is in a situation where there is a concern for a possible fire etc. they are allowed to extinguish the lights after 30 minutes.