The key is in the definition and usage of the expression dar cuerda. As defined in the DRAE,
dar cuerda a un mecanismo
- loc. verb. Tensar la cuerda o resorte que lo pone en marcha y le permite funcionar.
In English we say wind [up] a clock, wind a watch (where "up" is optional), but in Spanish it's different, we say dar cuerda al reloj.
There are other expressions that follow this pattern, for example
dar fin a: to end
Compare the sentence you were having trouble with to
deberá dar cuerda al reloj de madera durante toda su vida
I think that once you understand how this expression, dar cuerda a works, the sentence you asked about will make more sense.
Here is a crude literal translation of the sequence of words, that may help you see what's going on:
le colocarán un reloj de madera, al que deberá dar cuerda | they will insert/install a wooden heart, to which he will need to provide spring action