Slots and ports are physical connection points that allow the hardware of a computer to be expanded. A port is a socket. A slot is a dock for a printed circuit board.
Slots are also called "expansion slots" because they allow the computer to be expanded. The circuit board that fits into the slot is also called a "card." At the back of a desktop computer, you will see a number of blocked letterbox-shaped openings. These show where the slots are on your computer. Cards that include ports need to protrude through the case of the computer so that users can connect peripherals.
A card may include ports, although it does not have to. A sound card might just enhance the existing functions of a computer, in which case it would not need ports. If it controls speakers and microphones, it will have ports and sockets that need to be accessed by the user.
Slots and ports enable owners to upgrade their computers. Ports are the easiest to use. You might have an external drive connected to a port on your computer. When you want to upgrade this device, you only need to unplug it and plug in the new external drive.