How many candles should one light on Erev Shabbos and Yom Tov? And why that number?
The purpose of lighting is to prepare for shabas in a respectable way and provide visibility during the night. The former is a fulfillment of the rabbinic requirement to "honor" shabas, and the latter is a fulfillment of the rabbinic requirement to "enjoy" shabas. Notably for both of these considerations, the Ramba"m states that the requirement is "that a candle is lit", since it depends so much on the external functionality of the light (for attractiveness and visibility) and not the act of lighting.
Only one flame is required, but it is a very widespread custom to light two - one for each of the positive Biblical commandments "זכור את יום השבת" (mention the sabbath day) and "שמור את יום השבת" (keep the sabbath day).
To supplement, not supplant, WAF's good answer, which indicated that the reason for two candles is that they correspond to "זכור" and "שמור", I'll note that on holidays two are lit also, corresponding to man and woman. (I don't pretend to understand this correspondence, but that's what Taame Haminhagim 260 says, citing the Eliyahu Raba. He (TH, in the kuntres acharon 14, q.v.) further cites the B'ne Yisaschar as saying "I've heard from those who are careful that one should light thirty-six lights for Shabas" and giving a reason.)
first of all meicar hadin you need only one. in any case most people light 2 because of shamor and zachor. including many single bahurim. when married there's also the logic of one candle per person in the household, so a young couple 2 and then 1 more for each child. but you go only up not down in kedusha, meaning you only add candles but don't retract, after a child gets married for example the mother keeps lighting the same number of candles.
I met a lady once that added some candles more after the iom kipur war, she made some kind of deal with H' itbarach that if her husband got back from the war she would add on the shabat candles.
also some people add a candle if they forget to light (as opposed to not being able to for some reason)
Another reason to light two.
The numerical value of the Hebrew word for candle ("Ner") is 250. The Ramah, in Darcei Moshe 271:8, brings in the name of the Maharil that one should look at the candles during Kidush as a healing for the loss of eyesight caused by taking big steps. The Talmud (Shabbat 113B) says that every big step one takes removes 1/500th of the brightness of a man's eyes.
2 times "Ner" is 500, and looking at the candles restores the eyesight.