Addressing an envelope to a person using an incorrect title can offend the recipient. There are different ways of writing to someone who holds a Ph.D. that adhere to the proper etiquette. But ideally you would want to find out what the person's preferred mode of address is.
Address a Ph.D. holder on an envelope by writing their name, followed by a comma and then "Ph.D." For example: Jane Smith, Ph.D. Note that you should not use two titles when addressing the person. For example, do not write: Dr. Jane Smith, Ph.D.
Address the envelope by writing "Dr." followed by the individual's name. Use this if you know that the individual uses the title of Dr. in everyday usage. It is mostly Ph.D. holders who work in a health profession or in academia who prefer this usage.
Address the Ph.D. holder as "Mr." or "Mrs." Many holders of Ph.D. qualifications who do not work in academia or a health profession do not call themselves "Dr." in common usage, nor would they expect you to use the abbreviation of their qualification when addressing an envelope to them. If this is the case, then you should address the envelope to "Mr." or "Mrs." followed by the person's name. For example: Mrs. Jane Smith. Only use this address if you are certain that this is the Ph.D. holder's preference.
If you are addressing the Ph.D. holder using their name, followed by "Ph.D." on the envelope, do not apply this format to the beginning of the letter inside. In this case, use "Ph.D." on the envelope and "Dear Dr." followed by the person's name as the letter's salutation.