Compare hostel and hotel costs.
The two pricing models scale in opposite directions. A hostel charges per bed, so cost rises linearly with every extra traveller. A hotel charges per room whether one person or three occupy it, so cost per head falls as the group grows. That makes group size, not nightly rate, the deciding variable — and the break-even figure names it directly: below that many travellers the hostel wins, above it the hotel does. Included breakfast and kitchen access shift the line further, since self-catering typically saves 15 to 25 per person per day over eating every meal out.
Totals
Hostel = bed rate x travellers x nights; Hotel = room rate x nights + extras x travellers x nights
Break-even group size
Travellers = (room rate + daily extras) / hostel bed rate
Because the units differ. A hostel prices a bed and a hotel prices a room. Two people in a hostel pay twice one person; two people in a hotel pay the same as one. Around three travellers the lines usually cross, and beyond four a private room is frequently cheaper as well as more comfortable.
Typically 15 to 25 per person per day if you actually cook, and more in expensive cities. It is also the reason long-stay travellers favour hostels well past the point where a private room would be cheaper on the room rate alone — the accommodation is the smaller half of the saving.