According to this question and the corresponding answer, schools are legally allowed to confiscate items from students. This is not considered theft, as the intent is not to permanently take the item away from the student.
My question now is, how long is a school allowed to confiscate items from a student? "Common Sense" would indicate something like until the end of the class, or the end of the school day - or more formally, until the student leaves the school building.
However, I recall teachers confiscating phones until the end of the week, and even refusing to hand them back upon the parent's request, citing that "the student would just play on their phone again anyways". I can't imagine that this is legal, or that a teacher has the authority to confiscate an item for longer than necessary.
I am mostly interested in answers regarding Austria, but answers regarding other jurisdictions are accepted as well. Furthermore, I am talking about "general" items in a student's rightful possession. This excludes things like cigarettes, alcohol, weapons, etc., which may by themselves warrant different procedures.