Lent lasts for 40 days. Lent is the 40-day period that leads up to Easter; it begins on Ash Wednesday and runs for 40 days, not including Sundays. Lent ends on the Holy Saturday before Easter.
Sundays are not included in the calculation of the starting and ending 40-day period of Lent, since Sunday is the day that it is believed that Christ rose from the dead. Sundays are spent in celebration of the resurrection of Christ for the salvation of man.
Lent lasts 40 days because of the significance of the number 40 throughout the Bible. For instance, Jesus spent 40 days in the wilderness fasting and praying, and Moses was on the Mountain of God for 40 days.