In most locales, Shabbat candle-lighting time is eighteen minutes before sunset.
Shabbat begins at sunset and it is forbidden to light candles on Shabbat. In order to provide a margin for error, the accepted custom is to light the candles and usher in Shabbat eighteen minutes earlier.
If one missed candle-lighting time, it is still permissible to light the Shabbat candles until sunset. After sunset it is forbidden.
It is permitted to light candles and usher in the Shabbat earlier, if one so wishes. This is common practice in places where nightfall in the summer months is quite late. The earliest one may do so is plag hamincha, 1¼ halachic hours before sunset. Click here for the time of plag haminchah in your location.
Click here for holiday candle lighting time information.