You really need to say what you are trying to acheive - the question is really a little open. There are too many ways to discover the IP of another host on the internet, an intranet, a big lan etc which depend on what is happening. For eg. If the remote PC accesses a web page, you can pull it's IP off the web server ... though the user may be hiding or spoofing another's IP.
Considering the ssh context - perhaps you just want to be able to login via ssh to your own PC over the internet - thus creating a mini VLAN. To do this means you need to know the external IP of your computer.
As well as that, you need to set up port forwarding on your machine, so people scanning port 22 won't pick up that there is an ssh shell login there which they could brute force.