Hostels started out as a youth/student offering, but these days anyone can stay in a hostel, and you can even book a private room in many of them.
The catch is that standards are typically very basic — though usually cosy and friendly. Meals are not usually provided, but you will have access to a kitchen where you can prepare your own meals.
You will often have access to other services too, such as washing machines and driers, internet access, etc. — so hostels are often the best option for backpackers, not just the most affordable.