In a penalty there is no defensive wall.
In a free kick a goalkeeper puts 5-8 players in a line blocking the goal from the free kick taker, this limits the space in which the attacker can score in.
Chat with our AI personalities
When a free kick is awarded, not a penalty, and there is a chance the the player taking the kick could reach and score a goal, several players stand side by side between the ball and the goal. This forms the 'wall'.
On a penalty kick, the defensive "wall" is one person, the goalkeeper, who must be on the goal line between the goalposts until the ball is kicked. The penalty mark is 12 yards from the goal line, so the "wall" (goalkeeper) must be 12 yards from the ball.
On a free kick (sometimes mistakenly called a "penalty kick outside the box"), all defensive players (including the "wall") must retreat to at least 10 yards from the ball. On an indirect free kick within the penalty area, the defenders may stand on the goal line between the goalposts even if it's less than 10 yards away (but it will always be at least 6 yards, because no attacking free kick is ever taken inside the goal box, which is 6 yards from the goal).