Cloth Bake: Save frames in timeline as shape key?
Make sure the "NewTek MDD format" add-on is enabled in the user preferences, and then select the object and go File > Export > Lightwave Pointcache (.mdd).

This will save a mesh cache file of the cloth simulation. Then you can remove the cloth simulation entirely (or just disable it if you might want to make changes later), and then import the .mdd file you just exported (File > Import > Lightwave Pointcache (.mdd)).

This will apply each frame of the simulation as a separate shape key on your object, and animate them on and off automatically for the appropriate frames.



You can then delete all the shape keys that you don't want and remove the animation by right clicking on them and choosing Clear Keyframes.

If you have a few too many shape keys to remove by hand, a little bit of python can save a lot of time:

import bpy

obj = bpy.context.object

keys_to_keep = ["frame_0020", "frame_0040"]

i = 0
for s in obj.data.shape_keys.key_blocks:
    obj.active_shape_key_index = i
    if s.name not in keys_to_keep:
        bpy.ops.object.shape_key_remove(all=False)
    else:
        i += 1