The main risk factors for developing melanoma include a history of sunburns, excessive exposure to UV radiation, having fair skin or a large number of moles, and having a family history of melanoma.