You say "it took ___" to express what was needed to do something. For example:
It took two weeks to pack up all of our stuff for the move.
This means that you used two weeks for packing, and those two weeks were needed to do it.
You can use "it took ___" in a similar way for other qualities. For example:
It took a lot of courage for you to speak in front of such a large audience.
It took years and years of practice to get this good.
The structure of "it took..." is "It took (something) for (someone)(to do something)".
It took five years for the Nelsons to pay back the loan.
That tells what quality, who needed it, and why they needed it. If who you're talking about is obvious, you can just say what was needed and why:
It took five years to pay back the loan.
Or just say the thing that was needed:
It took five years.