What is the role of resistor in this schematic?
LED resistor

I originally thought you were asking about this resistor.  I'm leaving the explanation here since it might be useful anyway.

The point of this circuit is to let you get some intuition about flip-flops.  To do that, the LED is hooked up so that it lights when the flip-flop output is in the high state.  

However, the output of the flip-flop tries to be a voltage source, which is a bad match for driving the LED.  It's also at the wrong voltage anyway.  The resistor drops the voltage between the flip-flop output and the LED's on voltage, while letting a predictable amount of current flow in the process.

Let's say the flip-flop is powered from 5 V, that you want to put 5 mA thru the LED when the output is high, and that the LED is a common green type that will drop about 2.1 V when on.  That means the resistor will have 5.0 V - 2.1 V = 2.9 V across it.  We already said it needs to allow 5 mA thru it in that case.  From Ohms law, 2.9 V / 5 mA = 580 &Omega;.  The standard value of 560 &Omega; is close enough and should work fine, as long as the flip-flop output can source the 5 mA.  Many digital outputs can do that, but not all, so you have to check.  If the flip-flop can't source enough current to drive the LED to sufficient brightness, you can use a transistor in between.

Switch resistor

I see now you asked about the other resistor, the one that is connected to the switch.  That's a pulldown resistor.  It makes the flip-flop input reliably go to the low state when the switch is not pressed.  It's value is a compromise between pulling the input hard enough low when the switch is off, but not requiring too much current thru the switch when it is pressed.

I go into a lot more detail about pullup (same thing, just the switch and resistor flipped) resistors at https://electronics.stackexchange.com/a/23647/4512.