If you want to read up on networking, one of the The books, is "Stevens" aka
TCP/IP Illustrated, Volume 1: The Protocols, by the late Richard Stevens. It is possibly not the easiest book in the world to read, but I've always found it quite useful.
Just to attempt to clarify what has been said, pretty well, by others above; The machine in front of you will be on a "local" subnet, ie a network where you can "see" all the other machines on this network. To get any further, the router will redirect any other packets onto other routers and so forth until they hit the required destination machine.
Your machine will generally know whether an IP address is in it's local network or not by the Subnet Mask, which will often be something like 255.255.255.0. This is used to mask the address of your local machine, and the address of the required destination machine. If the masked values are the same, then both machines are on the local sub-network, and can talk directly to each other, if not, then the packet will be forwarded onto your router (ie Gateway in windows terminology) and it will then have to decide what to do with the packet.
With most home ADSL connections, all the router will do is forward the packet onto the ISPs router. The ISP will have much more complex algorithms implemented on their routers, which together with the rest of the Internet will get your packets where they need to be. The details of
routing packets is a
very big and complex topic.