All perfect praise be to Allah the Lord of the Worlds. May His peace and blessings be upon Prophet Mohammad and upon all his family and companions.
Water that has been endowed (Waqf) for drinking or ablution inside mosques must not be taken outside—whether in cups, cooling devices, or by filling personal containers. The fundamental principle in Waqf is that its benefits should be utilized by the designated recipients. Anyone who takes from it beyond its intended use has taken something without rightful entitlement.
Therefore, whatever is inside the mosque is only for the benefit of those inside it. It is not permissible for someone who is not praying in the mosque to use or benefit from it unless the donor (who endowed the water) has allowed it or if there is a well-established custom known to and approved by the donor. In this regard, Al-Imam Ibn Hajar Al-Haytami (may Allah have mercy on him) was asked: "Regarding the water donated for purification in our mosques, is it permissible for someone to take it to his private quarters and store it for personal purification, while preventing others from accessing it when there is a need for it in the mosque? And is it permissible to do so even if others are not prevented, or not?"
He replied: "Whoever donates water, or endows a purification resource to a mosque, it is not permissible to take it from there for purification or any other use, whether people are prevented from using it or not. The water designated for the mosque cannot be moved to another location, such as a private room mentioned in the question. Yes, someone who enters the mosque and performs Wudu with it is not required to pray there, even if the endower intended to increase his reward by providing it. However, the wording of the donation doesn't explicitly support that understanding. All of this applies unless there is an established custom during the time of the endower that is known and accepted, in which case the endowment would follow that custom as if it were a condition of the donation." [Al-Fatawa Al-Fiqhiyah Al-Kubra/Vol. 3/P.266].
Al-Imam Muhammad Al-Jawi As-Shafiee (May Allah have mercy on him) stated: "It is not permissible to transfer the water designated for drinking from its intended place to another place, such as taking it to one's home for drinking, unless it is known or there is evidence that the donor allows it. Similarly, if someone permits food for another to eat, it is not permissible to take any from it or feed others, unless it is known that the giver allows it. If there is doubt, the established custom and evidence should be considered." [Nihayat Al-Zayn/Vol. 1/P.36].
This water placed in mosques is provided for public use, not ownership. Therefore, it is intended to be used as needed, and it is not permissible to exceed the amount needed. Since Al-Imam Al-Khatib Al-Sharbini (may Allah have mercy on him) said: "The guest should not consume all of the food presented to him. Ibn Al-Sabbagh stated this, and Ibn Shahbah pointed out that this may be reconsidered if the quantity is small, and the custom suggests it is acceptable to consume all of it. This is clear if the owner’s consent is known. Besides, Al-Mawardi declared it is forbidden to consume beyond satisfaction if the owner’s approval is not known, and if one does exceed, they will not be liable. Al-Adhri pointed out that this requires careful consideration."
Furthermore, Al-Imam Ibn Abd Al-Salam (may Allah have mercy on him) explained that the definition of being "full" is when a person is no longer considered hungry. As for eating more than what is necessary from one’s own lawful wealth, it is disliked (Makruh). Similarly, it is disliked to eat more than necessary from someone else's wealth, even if the owner consents. He also stated: "Even if the guest eats as much as ten people, and the host is unaware of the guest's condition, it is not permissible for the guest to eat beyond what is customary. Furthermore, if the food is little and the guest quickly eats large bites, thus consuming more than his share and depriving others, it is not allowed." [Mughni Al-Muhtaj/Vol. 4/P.410].
In conclusion, it is not permissible to remove water from mosques to the outside unless the donor has permitted it, or there was a recognized custom during their time, and the donor was aware of it. If there is no knowledge of the donor's permission, and no established custom, the default ruling is to prohibit taking the water out. And Allah The Almighty Knows Best.