If you want to play with a friend over the Internet you can use the built-in multiplayer support for the game you want to play, but this feature has to be implemented by the developer. If the game features Single Player mode only then multiplayer is not an option.
Another method is to use a Lan-over-Internet application like Tunngle or Hamachi because these programs have the ability to create a virtual network between two computers from different locations.
These applications are easy to configure. You both will need to install one of them then connect to the same network and start the game you wish to play. From the multiplayer menu choose LAN/Internet and create a game.