Copyright in a painting belongs to the artist unless he or she signs it over to the new owner of the painting. You then relinquish the right to reproductions and, most likely, the right to make another identical or very similar painting. Buying the physical painting does not give someone copyright of the painting; you (or your agent) have to transfer copyright to the new owner in writing.
Note, however, that the purchaser may be able to defend his right to having a unique image, even if you retain the copyright. For example, if you have created limited edition prints, you can never produce more than the number originally stipulated.
Make the ownership of copyright clear to anyone who buys a painting from you clear up front by including it in the sales documentation (such as a certificate of authenticity). Take a leaf out of the book of artist Karen McConnell who says:
"I sell most all of my original paintings with a 'Statement of Value' which includes (1) date of sale (2) price paid (3) whether it was purchased framed or unframed and (4) notice that copyright for the work remains with the artist. At the bottom of the form is a place for dated signatures from both myself and the purchaser. I keep a copy, and they keep a copy."
As far as protecting your copyright by mailing yourself a copy of a painting and then never opening the envelope, this is known as "Poor Man's Copyright" and is a copyright myth -- see Poor Man's Copyright from Copyright Authority.com for details.
Go to Full Artist's Copyright FAQ.
Disclaimer: The information given here is based on US copyright law and is given for guidance only; you're advised to consult a copyright lawyer on copyright issues.