What is Walling? Walling refers to the use of buildings in order to make a choke more narrow (and thus easier to defend) or even completely blocked off in some situations. Applications are usually defensive, but they can also be used offensively to trap players in early on, or in any likely place of battle (usually late game) to give an advantage to your ranged units fight against melee (or lesser ranged) units.
How do I wall? Well with Terran, it's pretty easy. Protoss slightly less so and Zerg being (close) to unable to wall.
Terran players create walls much more frequently than other races do because of the versatility they have from the Supply Depots ability to lower into the ground as well as the ability of most of their buildings to Lift off. Most common Terran walls are composed of two Supply Depots and a Barracks or one Barracks, one Factory and one Add on.
With Protoss you can use a combination of Warpgates and pylons with other buildings to create a wall but you CANNOT lower them like Terran players can do to supply depots.
How do I make a right wall? Well, it's not too hard. First off is a wall that will not allow units through like this one:
As you can see these structures overlap, thus disallowing units to pass through.
Any buildings adjacent to each other horizontally or vertically will completely block units from passing between them. If two buildings are placed diagonally so that only their corners meet, only small sized units can pass between them.
Is it bulletproof? Lol, No, nothing in SC2 is bulletproof, Enemy units that have equal or greater range than your own units can safely attack the wall itself, while your own units cannot attack back from behind the wall. This is a reason why Protoss players do not normally wall against Terrans, who get ranged Marines very early. Similarly, Protoss players can sometimes take advantage of the range of a Void Ray to attack a Terran wall from outside the range of defending marines.
A wall composed of weaker structures such as Supply Depots or Pylons early on can present a false sense of security, as Zerg players can perform a Baneling Bust to easily break down the wall, leaving the defender with few units to defend against the flood of zerglings breaching your wall. For this reason, Terran players tend to use Barracks and Factories for their wall as they are much harder to destroy, and can still provide the door function by lifting off. Protoss do not have this advantage and would have to destroy the building (or cancel before it finishes construction) to provide through access.
If your wall of supply depots or pylons is breached, you can become supply blocked, rendering you unable to reinforce or produce more units during the attack.