How can skin cancer affect the whole body?

Usually doesn't. However sometimes skin cancers can metastasize and spread to distant parts of the body. Also, the same sun damage which caused one skin cancer, has made other parts of the skin vulnerable to cancer as well.
Skin. Some skin cancers such as melanoma have the potential to spread through the blood or lymph to other internal organs.
If it spreads. Typical skin cancer such as a basal cell cancer or a localized squamous cell will not affect the whole body. Only a squamous cell or melanoma that is advanced and spread will affect other areas of the body.