From Straight Dope
“He traces it back to pre-Christian times, when the cross was a symbol of unity and benign spirits dwelt at the intersection point. A wish made on a cross was a way of “anchoring” the wish at the intersection of the cross until the wish was fulfilled.
Panati says this superstition was popular among many early European cultures. It originally took two people. A comrade or well-wisher placing his index finger over the index finger of the person making the wish, the two fingers forming a cross. The one person makes the wish, the other empathizes and supports. Over centuries, the custom was simplified, so that a person could wish on his own, by crossing his index and middle fingers to form an X. But traces remain—two people hooking index fingers as a sign of greeting or agreement is still common in some circles today.”