Once chosen a world card becomes impossible to remove or change. You can visit the available worlds in any order, as enemy health and strength scales with each floor, leaving you to choose which you want to visit first, or last. They are always gained by progressing through the story, often after defeating a boss.
World cards are used to select the card-world you visit on each floor. Riku underwent a similar trial, learning about the cards and several mechanics unique to him through DiZ pretending to be Ansem. In the Room of Beginnings Sora and his friends met with Leon, who gave him further instructions on various card mechanics.
In Traverse Town Sora found that both his friends had also turned into cards, as Marluxia explained the basics to him. This was after Donald attempted to hit him using spells, showing that the castle had already made them forget all they knew on entry. The first card introduced in Chain of Memories was the Traverse Town world card, produced by a hooded Marluxia who sampled Sora's memories to make it.