You have to ask other players what their Friend Code is and then you can register them in your PalPad which is located in your Key Items section.
To get a Friend Code first go upstairs in the Pokémon Center and go in the Wi-Fi Club (Middle Door) it will say that you can't go in the actual room because you don't have any friends registered in your PalPad but also asks you whether or not you want to receive your Friend Code. Click yes and it will connect to the internet and give you a Friend Code. It will then disconnect you from the Wi-Fi Club. After it disconnects you go in your PalPad and it should be there under the third option.
After you have received your Friend Code you can then give it to other players so they can register you on their console. Once they have done that they are then able to battle and trade with you online through the Wi-Fi Club.
To register other players in your PalPad, first bring up your PalPad and select the option register Friend Code. Then type in your Friend's Name and Friend Code. An example of a Friend Code could be:
Friend Code: 0824-9751-0628
Once you have entered the correct details you should be able to enter the Wi-Fi Club properly since you have added a Friend Code in your PalPad and be able to interact with the player who's friend code you have just added providing that both players are in the Wi-Fi Club at the same time.
For more information check out these links.
Hope I helped :)