Press "U" to save a replay. You can do this at any time during a level, or on the post-level screen. By default it'll automatically name it, for example, "Warm_01.lrb" for Warm 1, etc. If you want to override this and set custom names, just go into the config menu (press F3 on the title screen) and turn "Automatic Replay Names" off; if you do this, when you save a replay a Save File dialog will come up and let you enter a filename.
Keep in mind that replays made on V1.28n and newer can't be viewed on V1.27n and older. The reverse is fine though; V1.28n+ can view replays from older versions.