Basically, if you are between Route 4 (the Sandstorm route) and Route 10 (Victory Road entrance) and you have your C-Gear on, you can be connected to via the Entralink.
They will join your world using their multiplayer avatar (what you would see in the Union Room), unless they are doing certain select things that turn them temporarily into a Pokemon. You can tell which thing running around is your friend by being able to walk through them.
Your friend, using the Entralink, can complete "Missions", little sidequests that involve things like challenging you to a Flat Battle, hiding an item somewhere, or simply convincing you to talk to them ingame.
Some of these "Missions" involve turning into a Pokemon and convincing you to talk to them. Once you do, they will give you powers such as:
Halving the number of steps to hatch an egg for 30 minutes
Doubling experience gained from battle for 30 minutes
Doubling money earned from battle for 30 minutes
Not sure which missions allow you to turn into a Pokemon, but it's only when playing with a friend that you can do so.
Guide to the Entralink - Pokemon Online forums