I want to know how to make the player stop moving as soon as the input has stopped.

Here’s my code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour {

	public Rigidbody Player;
	public int Force = 50;

	// Update is called once per frame
	void Update () {
		{
			if (Input.GetKey (KeyCode.UpArrow))
				Player.AddForce (0, 0, Force * Time.deltaTime, ForceMode.VelocityChange);
			else 
				Player.velocity = Vector3.zero;
		}

		{
			if (Input.GetKey (KeyCode.DownArrow))
				Player.AddForce (0, 0, -Force * Time.deltaTime, ForceMode.VelocityChange);
			else 
				Player.velocity = Vector3.zero;
		}
	}
}

Try using FixedUpdate instead of Update, physics calculations are not done every frame, rather they are done on a different timer.