Melanoma is one of the most aggressive malignancies of the skin. The genetic composition of melanoma is complex and varies among different subtypes. With the aid of recent technologies such as next generation sequencing and single-cell sequencing, our understanding of the genomic landscape of melanoma and its tumor microenvironment has become increasingly clear. These advances may provide explanation to the heterogenic treatment outcomes of melanoma patients under current therapeutic guidelines and provide further insights to the development of potential new therapeutic targets. Here, we provide a comprehensive review on the genetics related to melanoma tumorigenesis, metastasis, and prognosis. We also review the genetics affecting the melanoma tumor microenvironment and its relation to tumor progression and treatment.