Jeff is certainly on the right track here, search this forum by keyword dimmer switch and you will get several posts.
The three wires are necessary for the dimmer to function.
The switch will have a supply, load and ground wire. I would hope there would be some instructions or a diagram on the switch to indicate which wire is which.
My came with instructions, as he indicated you can use a meter or test light to figure out the coach wires.
Read thru the post that are returned from your search, they will help you.
A second look at you pictures and I see an instruction sheet folded up in the bag in your picture, the ground circuit that your switch would tie into is the 3 splice connection, that leaves the supply and load side to figure out on your switch, give those instructions a read. follow back up if more help is needed.