You have essentially 2 choices that fit with the internet model.
1. Client Server. You find an internet service provider that runs or will run a piece of server software, like the Apache Web Server for example, which will allow connections to be made to it over the internet and data to be sent and recieved. 2 or more Clients can then connect to this server and exchange data with it and ultimately with one another. Now you have Facebook!
2. Peer to Peer. You make the Client Part and a small Server Part in one piece of software. Each user runs the software and a peer-to-peer network of sender/recievers is formed by all the running instances. Now you have BitTorrent!
The actual sending and recieving part is done with a set of technologies called the OSI stack. You'll already know about one of them, IP (Internet Protocol) because without an IP address you couldn't be online posting questions to Code Project.
At the top of the protocol stack, above IP and TCP (Transmision Control Protocol) in what is called the application layer are technologies like Sockets.
You can use Socket programming to send and recieve data over the internet in a way that makes it very very similar to reading and writing a file, except the 'file' is really a connection to another computer at the IP address you use to set up the socket.
There are loads of books and more stuff online about this than you could read in a 100 years. Google for a simple Chat program in your programming technology of choice to get started. Sockets are a great technology to master especially if you want to get paid for writing code.