Although I honestly believe, your question would be more suited for a geological subbreddit than here, because you ask where and not when, let me try my best.
In an article of miningweekly states in short:
Although the origins of gold mining in predynastic Egypt are shrouded in mystery, it is likely that, during that period, the metal was extracted from alluvial deposits. It was only with the advent of the early dynastic period, from 3100 BCE onwards, that gold began to be extracted by systematic mining. Some of the earliest mining operations were conducted in the granite mountains east of Coptos and further south, in Nubia, between the Nile and the Red Sea, during the early dynastic age.
While this may sound a bit shallow, let me back this up with these figures from the Journal of African Earth Sciences.
I hope this provides you an overview to your question. If you are not satisfied with my superficial excerpt, I invite you to read the original 16-pages scientific paper Gold of the Pharaohs – 6000 years of gold mining in Egypt and Nubia from the Journal of African Earth Sciences, which - as a non-geologist - I found a bit hard to process due to the technical language it uses.
I can't believe it is necessary to write this but the next person who posts a response saying nothing but "Egypt", "in the ground", "the desert" or any variation thereof will receive a ban.
Our rules clearly state that answers in this sub should be comprehensive and in-depth and while humor is acceptable to work into a such an answer, this especially clever joke got really old, really fast after being posted 10 times.
Consider yourself warned.