Final answer:
The gubernaculum attaches the testicle to the scrotum, aiding in their descent during fetal development.
Step-by-step explanation:
The structure that attaches the testicle to the scrotum is the gubernaculum. During the seventh month of a male fetus's development, the testes move through the abdominal musculature and descend into the scrotal cavity in a process known as the "descent of the testis." The gubernaculum is a connective tissue structure that helps guide this descent. If one or both of the testes fail to descend, a condition referred to as cryptorchidism occurs.