If you are using SATA drives, you do NOT need to set any jumpers normally, and there is NO such thing as Master and Slave settings for any SATA device.
For IDE (aka Parallel ATA, or PATA) devices, jumpers need setting properly. Start by recognizing that ANY IDE port can support up to 2 devices on it. This requires a data cable with 80 wires in it in a flat ribbon, although the connectors on it are made with only 40 holes, and one of them is blocked off. The cable has THREE connectors on it - BLUE on one end to go to the mobo port, BLACK on the other end to go to the device you set as Master, and GREY in the middle to go to the Slave (if you have one).
Because the port (and cable) can have TWO devices on it, these two need unique identifiers. The system used is to set jumpers on pins on the back edge of the device to make it either the port Master or the port Slave. NOTE that EVERY IDE port must be operated this way - that is, EACH IDE port MUST have a Master device on it to operate, and MAY have a Slave device also.
To set the jumpers, look for a diagram on the device itself. It will show you how to install jumpers for these possibilities: Master, Slave, or CS (Cable Select). A few HDD's have two different settings for Master with No Slave, and Master with Slave Present. Each IDE device may have a different way to set the jumpers, so use ONLY the diagram on the device you are setting up.
The simple system is to make one device the Master and connect it to the END (Black) of the ribbon cable. Any IDE port MUST have a Master device. Then, IF you are adding a second device to that port / cable, set its jumpers to make it the Slave and plug it into the MIDDLE (grey) connector. Don't forget to connect power wires to each HDD, also.
The alternative is to set BOTH devices' jumpers to CS. In that case the one you plug into the END connector WILL be the Master, and the other the Slave.
IF you have both a hard disk and an optical disk unit sharing one IDE port / cable, it used to be advised that the HDD should be set as the Master, and the optical unit as Slave. This was because early optical devices could not perform that Master role when a HDD shared the port with them. I do not think this is a real problem any more, but I still tend to follow that guideline.
As I said, if you have two IDE ports and use both of them, make sure to set up Master and Slave on the second port in the same way.
Do NOT think of the word "Master" as meaning the Master drive for the whole machine. There is no such thing. Master and Slave have meaning only in the context of ONE IDE port. A long time ago the Primary IDE port Master device was, by default, the machine's BOOT device, but no more. Now, quite separately from that whole port thing, you use a setting option in the BIOS to specify which device(s) are used as the BOOT Device, and in which order.