Dwarves will seek to claim an unclaimed room when they look for a bed. There's two practical ways this scenario resolves:
Scenario A - Assigned Bedroom
- You manually assign the Dwarf a bedroom
- The dwarf goes to the bedroom when tired
Scenario B - No Assigned Bedroom
- You have not assigned a tired Dwarf a bedroom.
- The dwarf finds the nearest un-claimed bedroom and claims it.
- The dwarf is now assigned this bedroom, and will hereafter follow scenario A
Scenario C - No Available Bedrooms
- You have no bedrooms available
- the dwarf finds the nearest open bed and falls asleep.
- it is possible that they sleep in an owned bed, but they seem to prefer going to a dormitory or barracks before they sleep in an owned bed or just fall asleep in the dirt.
Note: sleeping outside of a proper bedroom will not increase a dwarf's happiness, and may decrease it if they are forced to sleep on the floor. Nobles may also throw a tantytantrum if a lower noble or a commoner has a nicer (bed)room, so it may be wise to assign them the most opulent space available.
So in general, you don't need to worry about assigning dwarves bedrooms manually - as long as you have unclaimed bedrooms available, they will seek them out as needed.
One final note: Dwarven families share beds and bedrooms.