Too often the family home is too tight and additional space is needed for sleeping purposes for family members. The use of a basement space or attic is the likely location to use especially when the area is partially finished and is so convenient to convert. Unfortunately by doing this it can be placing the individuals who will be occupying the space in grave danger. A sleeping area require light ventilation and emergency egress through a door immediately in the room or a window of a proper size. Along with the previous there is a requirement for a smoke and carbon monoxide detector to be placed as required by the codes.
Before any space is to be converted to a sleeping space or bedroom a permit would be required which will necessitate approvals from the Building Department and Zoning approval.
Remember whomever is to reside in this space can be risking their life if they are to occupy an unsafe space.