That depends on the reason for your dentist's recommendation.
If your metal dental fillings are defective or show decay, it's important to replace them. Untreated decay may eventually lead to an infection (abscess). In some cases, replacing metal dental fillings may benefit the long-term health of the tooth.
Generally, replacing metal dental fillings for aesthetic reasons should only be done after careful consideration and if your dentist feels it will not compromise the long-term health of the tooth. Likewise, there's no need to replace metal dental fillings because of concerns about mercury in the fillings.
Most metal dental fillings are dental amalgam — a stable alloy made with mercury, silver, tin, copper and possibly other metals. Although concerns have been raised over the years about the safety of mercury in dental amalgam, researchers have proved the concerns to be unfounded. The American Dental Association supports the use of dental amalgam as a safe, reliable and effective treatment for dental decay.
If you're unsure whether you need to replace your metal dental fillings, ask your dentist to explain the options and help you understand what's best in your case.