You may redeem the property at any time until your right to redeem has been foreclosed by a legal decree.
This means that you can pay off the debt to the County or Baltimore City and clear the lien on the property after the tax sale, but it must be before the lien purchaser receives a legal judgment that forecloses your right to redeem your property. Once the purchaser does this, it is too late to redeem and the purchaser may take title to the property.