Depending on the area where you live in the United States copper pipe was installed years ago because of it’s quality of material as apposed to galvanized pipe.
Like any material it will only last so long depending on the quality of water in your area, proper installation and quality of the pipe by the manufacturer.
The four types of copper pipe and the color coding system used to identify copper the pipe is the following:
1. (DWV) Drain waste & vent is yellow, used for sewer and the vent system.
2. (K) copper pipe is green, used for water main service, steam condensation and other usages.
3. (L) copper pipe is blue, used mainly in all commercial buildings.
4. (M) copper pipe is red, used for residential water supply.
Copper fittings for DWV are also marked with a yellow color and should only be used for drain and waste systems. The fittings used for K, L, M copper pipes use the same fittings for all three.
Depending on what part of the county you live in copper pipe used in homes last around 25-35 years using (M) copper pipe.
My advice is to use (L) copper for residential usage in all cases. Yes, the pipe cost a little more money but your life span will increase by ten years.
Proper installation is critical if you want your pipe to last longer.
By remembering some basic installation practices like always cutting your pipe squarely, reaming the pipe (red tool in picture), properly sanding your pipe and fittings, fluxing, adding lead/free solder, and by using quality copper fittings and valves you will have a good water supply system that will last for years.