Hi,
A Flip Flop is made up of master latch and a slave latch.
Setup Time: We need to provide enough time for the input capacitance of Master latch to be charged up or discharged down, before the Master latch captures the data. To ensure that this happens ,we have a setup time requirement. If we violate this setup time requirement. We cannot be sure what value will be captured by the master latch, may be 0, may be 1..
Hold time: Even after the Master latch has captured the data, the clock of Master gets disabled and the clock of slave gets enabled, now we should provide Enough time for the master latch to be fully disabled and slave latch fully enabled. If the data at input of Master latch changes and at that instant the clock of master latch had not gone into inactive level, then we might enter into metastability. To ensure this we have a hold check in a flip flop.