The underground maze is called labyrinth and is mythological linked to the labyrinth of Knossos Palace, built by Daedalus, where the evil monster Minotaur lived. Minotaur was killed by Theseus, blah, blah. We all know this myth...
Now, let's see the facts: There is an unknown cave in Messara Plain that was used as queries since the Minoan Era, that is called Labyrinth. This is very close to ancient Gortys and entrance is strictly prohibited, due to several accidents that have happened since the WWWII. Indeed, the Nazis used this cave for storing ammunition and was the largest German storing site in Southern Europe. When they left Crete, they exploded that and totally destroyed it. Since 1945, many locals were killed, while trying to find ammunition that had not exploded (due to lack of oxygen) so as to use that as fertilizer or making dynamites for fishing. Thus, the cave was sealed, till today.
This is the maze you refer to, where Minotaur was a symbol for the harshnesses that slaves faced and the "monster" that ate them.
Thus, the answers to your questions:
Do they know who built it? - It was built by the Minoans.
Why it was built? For extracting the stones for building the imposing Phaestus Palace
Exactly when it was built? In the minoan Era
A note: It was not intentionally built like maze, but it was a query. All queries are full of complex galleries. Of course, the locals exaggerated and turned that quite simple query to the haunted labyrinth of Crete.
You can see one of my articles about the Labyrinth Cave in my website that clarifies everything here:
http://www.cretanbeaches.com/Caves/Heraklion-Caves/labyrinth-cave/