which wires to connect when installing a dimmer switch?
Edit: From your picture and descriptions you appear to have a three way switch.  

Your dimmer is a single pole dimmer.  Meaning it is designed to operate in one location.  

A Lutron three way dimmer that is similar to what you have would have one red, one red/white striped, one solid black, and a green.

The two blacks off the switch wire to the black on the dimmer.  The one red goes to red, the one black goes to the red/white striped off the dimmer, and the green goes to the bare copper.

Be sure to turn off power first, and make sure the dimmer is rated for the correct load: Incandescent, LEDs, total wattage.