Praise be to Allah.
We put this question to Shaykh ‘Abd-Allaah ibn Jibreen, may Allaah preserve him, who answered as follows:
If there was no prior agreement, this is considered to be a gift and a donation, so she does not have the right to ask for it back at the time when she spent this money of her own accord. But if there was a prior condition that the money should be repaid, then Muslims are bound by their conditions and she has the right to ask, when the husband can afford it, for all that she has spent on his house and children.
And Allaah knows best.