Bereshit 1:5 says:
וַיִּקְרָ֨א אֱלֹהִ֤ים ׀ לָאוֹר֙ י֔וֹם וְלַחֹ֖שֶׁךְ קָ֣רָא לָ֑יְלָה וַֽיְהִי־עֶ֥רֶב וַֽיְהִי־בֹ֖קֶר י֥וֹם אֶחָֽד׃ (פ
And God called the light Day, and the darkness He called Night. And there was evening and there was morning, one day.
The Haamek Davar commentary explains this pasuk as follows:
And to the darkness, He called night: The Sages, of blessed memory, explained in the beginning of Tractate Pesachim, that the Holy One, blessed be He, called to darkness and appointed it over the night. [By this,] our Rabbis taught us that we should not say that darkness is only the absence of light, like when - in the middle of the day - we close the windows, it becomes dark. For, if so, it would not be a creation. But in truth, darkness is a creation, on its own as well, as it is written (Isaiah 45:7), "and created the darkness." And it is great distortion to say that darkness is only the absence of light. But rather, God makes both of them, just as He concerns Himself over holiness and impurity.
This explanation states that darkness is a creation on it's own rather than just the absence of light, and it even quotes Isaiah as direct evidence. However, the creation of light is explicitly narrated in Bereshit 1:3 :
וַיֹּ֥אמֶר אֱלֹהִ֖ים יְהִ֣י א֑וֹר וַֽיְהִי־אֽוֹר׃
and it's separation from darkness is recounted in Bereshit 1:4 :
וַיַּ֧רְא אֱלֹהִ֛ים אֶת־הָא֖וֹר כִּי־ט֑וֹב וַיַּבְדֵּ֣ל אֱלֹהִ֔ים בֵּ֥ין הָא֖וֹר וּבֵ֥ין הַחֹֽשֶׁךְ׃
But darkness (as well as the deep/תְה֑וֹם) is named on Bereshit 1:2 without a narration of its creation earlier:
וְהָאָ֗רֶץ הָיְתָ֥ה תֹ֙הוּ֙ וָבֹ֔הוּ וְחֹ֖שֶׁךְ עַל־פְּנֵ֣י תְה֑וֹם וְר֣וּחַ אֱלֹהִ֔ים מְרַחֶ֖פֶת עַל־פְּנֵ֥י הַמָּֽיִם׃
I understand that the account of Creation of Bereshit contains really deep meanings and may not be as literal as I may be taking it according to the sages' interpretations. However, I believe it is a valid question to ask: When did G-d create darkness?
I suspect darkness (and the deep) may've been in some way part of the creation of the heavens and the earth in Bereshit 1:1, but this is just a thought.
The answers I've received are wonderful and really well researched, however I will not be choosing one as the correct answer for the following reason: Menachem's answer explains the perspective of the Ohr HaChaim and the Talmud, which states that darkness was created in the first day, with a solid reasoning. While Mevaqesh's answer argues that darkness is in fact just the absence of light (and not a creation), and he justifies this point by quoting many different rabbinical authorities from different backgrounds and centuries who all agree with this interpretation.
I don't feel I'm entitled to choose which answer is the most correct based on my subjective opinion and I encourage the readers to check both of this great answers to get an understanding of both conflicting yet fascinating interpretations.