I've studied this in college some time ago. I won't go back in my textbooks or anything. I’m sticking to the essentials here.
Sun exposure IS related to skin cancer. Skin cancer is the most common cancer in the population (male and female), BUT most skin cancers are benign (the risk of causing a serious illness is really low, so you can live with it, but it's better to have it checked out anyway...).
Malignant (associated to high risk of complications including death) skin cancers (eg. melanoma) are not as frequent, but highly dangerous, so you better protect yourself by putting on sun tan lotion, covering yourself when going out in the sun or just avoiding staying in the sun for long periods of time.
Caucasians are at higher risk of getting ANY TYPE of skin cancer (malignant or benign), especially on body parts/spots that are frequently exposed to sunlight. Black people can also get it, but it’s harder to diagnose and sometimes they get it in hard-to-check places like under the fingernails.
Now the thing to beware of is FREQUENT and INTERMITTENT sun exposure. That’s the major cause of skin cancer. INTERMITTENT exposure to the sun is more dangerous than CONTINUOUS exposure, studies have found. Also, if you have moles (especially large ones) on your body,
You Might want to examine them yourself from time to time and note any changes in color, shape, size. If you see anything suspicious, have them checked by a doctor. Your doctor should examine your skin for any changes whenever he/she’s doing a complete check-up exam.
So my advice to those who wonder if they should avoid sunlight exposure is: don’t avoid it completely. It’s MOSTLY good for you since it turns the inactive form of vitamin D (that you already have in your body) to its active form (that helps calcium make bones stronger). But for that to take place you only need about 15 minutes of daily sunlight exposure on your extremities (eg. hands or feet). So be careful and protect your skin with sun lotion, hats, clothes, especially if you know that you’re going to spend a lot of time in the sun.
Hope it helped! You should, however, seek professional advice if you’re really concerned.