Nine members form the Fellowship when it leaves Rivendell. Elrond chooses the company to help Frodo carry the One Ring toward Mordor and to represent the Free Peoples opposing Sauron.
The nine are Frodo Baggins, Samwise Gamgee, Merry Brandybuck, Pippin Took, Gandalf, Aragorn, Boromir, Legolas, and Gimli. Together they include four Hobbits, one Wizard, two Men, one Elf, and one Dwarf.
The number is deliberate: the nine walkers are set against Sauron’s nine Ringwraiths, or Nazgûl. The Fellowship is not an army; it is a small travelling company intended to move discreetly and make the Ring’s destruction possible.
The group does not remain intact for the entire journey. Gandalf falls while battling the Balrog in Moria, Boromir dies defending Merry and Pippin, and Frodo and Sam eventually continue toward Mordor separately. “Nine” refers to the original company departing Rivendell, not every companion who later joins the wider quest.