@Chad Reynoso typically 5 years in a rental property. Tenants are harder on it than owner occupants.
A stain is not wear and tear. If you have to replace the carpet, the cost will probably be above his/her deposit. If it were me, I would keep the entire deposit.
I am newer to real estate so I am not sure about how the stains will effect what you can and can't do with the security deposit. However as far as replacing it goes, I have found that laminate flooring is a very good option. If you are just a little bit handy you can install it yourself, and its around $2-8 a sq. Ft. I imagine for a rental property you would want to stay towards the lower end of that I know I would. It lasts longer and looks better in my experience also no need to worry about stains!!
At the apartment complex where I worked (in CO), we replaced the carpet in the units after 5 years due to normal wear and tear. If there are stains all over the carpet, I would not consider that normal wear and tear. As David said, stains are not wear and tear they are damage. I would replace the carpet and deduct the amount from their security deposit.
I've been told that judges here will disallow any deduction for carpets older than three years. The IRS allows a five year depreciation schedule for flooring in general. In my experience it is completely unrealistic to expect 7-10 years for carpet in a rental. In a similar situation, I've used the five year schedule and the original cost of the flooring to determine the deduction. If the carpet was older than five years I would not deduct anything. If that's the case for you, I would speak with your landlord/tenant attorney and take their advice.