Pressing ESC will ESC will stop the rendering process.
However, if you are saving your render as a video file format your video may not be playable. In this case, I would recommend changing the render output file format to an image sequence like "JPG", "PNG" or "EXR". This will save every single frame as an image. You can then use Blender's video editor (or any other third-party video editor) to add an image sequence and render out the video in the desired format.
Set the end frame.
If you already know beforehand that you only want to render 50 frames it is easier to just set the end frame to 50. That way you don't have to intervene manually.