All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu 'alyhi wa sallam, is His slave and Messenger.
It was narrated on the authority of Abu Moosa that the Prophet, sallallaahu ‘alayhi wa sallam, said: "Allaah The Exalted created Aadam (Adam ), from a handful that grasped all parts of the earth. Hence, the Children of Aadam have varied (in appearance and traits) according to the nature of the earth. There came from them the white, red, black and (others with colors) in between, and (there also came from them) the wicked, kind, lenient, harsh, and (others with characteristics) in between." [Ahmad, Abu Daawood, At-Tirmithi. Al-Albaani and other narrators considered it as a Saheeh (Authentic) Hadeeth]
This Hadeeth shows that differences in the color of people's skin varies according to the differences in color of the earth from which Aadam was created.
Neither the Sharee‘ah nor experience accepts the saying that the skin color of some people has became black due to the heat of the sun. Any wise person obviously knows that. It is a fact that climate and heat affect skin color, but they do not affect the genes because when a black man moves to a cold region, the black color of his skin does not change. Also, when a white man moves to a hot region, his skin color becomes darker and when he returns to a cold region, his skin becomes whiter again.
The questioner asked if Allaah the Almighty created him as such and that there is a Divine Wisdom behind this. We state that everything in this universe happens by the power of Allaah The Almighty and due to His wisdom. Even if we consider the sun to be the cause of the skin color of some people being black, this would also be due to the wisdom and power of Allaah The Almighty.
Allaah Knows best.