On a local network, it's easy to connect to a remote PC – type its name or IP address into the Remote Desktop Connection box. But when you're trying to connect to your remote PC via the internet, things get a little more complicated.
First, make sure the Windows firewall isn't blocking Remote Desktop. You can check this by opening up the Windows Firewall section of the Control Panel and selecting Allow apps to communicate through Windows Firewall. Scroll down and make sure that there's a tick next to Remote Desktop.
Next, you'll need to make a few configuration changes to the router where the PC to which you wish to connect is located. This is usually done by connecting to the router via your web browser, using the IP address of your local gateway as the address. You can find this by opening a command prompt and typing ipconfig. This will also give you the IP address of the PC you need to connect to. Locate your router's port forwarding options and forward TCP port 3389 to the IP address of the PC to which you want to connect.
You need to know the external IP address of the PC to be accessed. To do this, open up a web browser on that PC and browse to a service such as myip.dk. This will tell you the address you need to type in to the Remote Desktop Connection dialog box when you want to connect to your PC via the internet. In many cases, this external IP address is subject to change. To avoid having to rediscover the address every time it changes, subscribe to a dynamic DNS service such as no-ip.com.
This will give you a memorable domain name to which you can connect, and will keep track of any changes to your external IP address. Many routers have built-in support for dynamic DNS, so have a look in your manual and select one of the services supported by your router.
You should now be able to connect to your PC both from your local network and via the internet.