Short answer. Until the case is over. Article 2007 provides that the custodian of sequestered property cannot be relieved of his responsibility until the controversy that gave rise to it has come to an end, unless the court orders otherwise. Responsibility runs with the litigation, not with any fixed term, and only a court order can cut it short.
What the law says
cannot be relieved of his responsibility until the controversy which gave rise thereto has come to an end, unless the court so orders
Civil Code, Article 2007 — Duration of the Sequestrator's Responsibility. Read the full provision →
The duty lasts as long as the dispute
A person appointed to hold sequestered property does not serve for a set number of months and then hand it back. Article 2007 ties his responsibility to the life of the case: the keeper cannot be relieved of his responsibility until the controversy which gave rise thereto has come to an end, unless the court so orders. The reason follows from why the property was placed in custody in the first place — to keep it intact until the court decides who is entitled to it. Release the keeper before that is settled and the whole purpose of the custody would be defeated.
Only the court can shorten it
The article leaves one exit: unless the court so orders. The keeper cannot simply decide he has had enough and walk away; the same court that placed the property in his charge is the only body that can lift the charge before the case ends. A court might do so, for instance, where the property is substituted by a bond, where a perishable asset has to be sold so its value is not lost, or where a new keeper is appointed in place of the first. Until such an order issues, the responsibility stays where it was put.
What being responsible actually means
Responsibility here is not a formality. For the whole period the keeper must preserve the property and be ready to account for it, giving it the care a prudent owner gives his own. If it is lost, damaged or diminished through his neglect during that time, he answers for it — the duty and the exposure run together. That is precisely why the law does not let him shed it at will: an obligation that could be dropped the moment it became inconvenient would protect nobody. The end of the controversy, not the keeper's preference, is what discharges him.
What this means in practice
If you have been appointed to hold property in a case, plan on being answerable for it until the case is finally resolved, and do not treat an informal lull — a settlement being discussed, a long adjournment — as a release. Get any early discharge in the form of an actual order, and keep it. If it is your property being held, the same timeline works in reverse: expect it back when the litigation concludes, and record its condition at the start so any shortfall or damage at the end can be raised against the keeper.