Often depends on the location and what they are aiming for.
For example, cheap hostels often have the rule that locals are not allowed to stay longer than about 2 weeks (to prevent people who use cheap accommodations from ruining the mood of the travelers who are looking for the hostel).
Also saw a similar limit for actual travelers – they want travelers, not backpackers on their work vacation, to use them as a base only. This can be for the mood or also because they can rely on the commissioning of activities that they receive, for example, from frequent different travelers.
A friend lived in a hostel in London for 18 months while working. I spent a few weeks in a single hostel in Argentina, Vancouver and Melbourne, Australia and got to know the staff, shared BBQs, drinks and the like.