How to specify frames for "Сycles" modifier in F-Curve editor?
The Restrict Frame Range values for f-curve modifiers doesn't work in the way you're trying to use it. Those values restrict the output region where the modifier's result can be seen. The modifier itself still applies to all the keyframes in your f-curve.

As a workaround, you can get the same effect you're looking for by using the Non-Linear Animation (NLA) editor. For your specific example, you'd use the Action Editor mode of the Dope Sheet to create two actions (both start at frame 1):


Action 1 (staging) - This is the non-cyclic animation. In your specific example, this would be the first 40 frames where you rotate from 0 degrees to 360 degrees.
Action 2 (cycle) - This is the animation you intend on cycling. In your specific example, this animation would be 20 frames long and rotate from 360 degrees to 270 degrees.


Use the Push Down button in the Action Editor to Add each action as a strip in the NLA. Start the staging action at frame 1 and the cycle action at the end of the staging action's frame (in your example, that's frame 41).

Now, with the cycle action still selected, go to the Properties region of the NLA (reveal it by pressing N with your mouse cursor in the NLA editor). Scroll down to the Animation Clip panel. The last slider in that panel is labeled Repeat. Increase that value for as many repeats of the cycle action as you need.

Here is a .blend file, based on your original example, that shows the work-around in action.