There's several different ways this can play out. I've drawn the following diagram to help make sense of this:

- A: The "Safe" side of the wall; no one takes damage here
- B: The Wall itself, 1' thick.
- C: The 10' field in "front" of the wall
- D: Beyond the limits of the wall; no one takes damage here
Based on how a character acts, they might or might not take a certain amount of damage.
Character at B when wall appears: 5d8 (DEX Save for Half) during the caster's turn
When the wall appears, each creature within its area must make a Dexterity saving throw. On a failed save, a creature takes 5d8 fire damage, or half as much damage on a successful save.
—Wall of Fire, Player's Handbook, pg. 285
Character stands in B through the entire duration of their turn: 5d8+5d8 at the end of their turn
One side of the wall, selected by you when you cast this spell, deals 5d8 fire damage to each creature that ends its turn within 10 feet of that side or inside the wall. A creature takes the same damage when it enters the wall for the first time on a turn or ends its turn there. The other side of the wall deals no damage.
—Wall of Fire, Player's Handbook, pg. 285
This needs to be closely examined. Per the RAW, the damage is listed twice. So this damage must occur twice. This might be an oversight/mistake in the spell description, but that is what it says it does.
As DM, I'd probably only use one source of fire damage at the end of the turn, given that I very strongly believe that this is a mistake/not the Rules as Intended. But that would not be a Rules-as-Written ruling.
Character moves from A to B: 5d8 when they enter, 5d8+5d8 when their turn ends
One side of the wall, selected by you when you cast this spell, deals 5d8 fire damage to each creature that ends its turn within 10 feet of that side or inside the wall. A creature takes the same damage when it enters the wall for the first time on a turn or ends its turn there. The other side of the wall deals no damage.
—Wall of Fire, Player's Handbook, pg. 285
As established previously, stopping the turn at B results in two sources of 5d8 damage. The only thing new is the additional damage from entering the wall.
Character moves from B to C: 5d8 damage when their turn ends
One side of the wall, selected by you when you cast this spell, deals 5d8 fire damage to each creature that ends its turn within 10 feet of that side or inside the wall. A creature takes the same damage when it enters the wall for the first time on a turn or ends its turn there. The other side of the wall deals no damage.
—Wall of Fire, Player's Handbook, pg. 285
Character moves from A to C: 5d8 damage when they enter the wall, 5d8 when their turn ends
One side of the wall, selected by you when you cast this spell, deals 5d8 fire damage to each creature that ends its turn within 10 feet of that side or inside the wall. A creature takes the same damage when it enters the wall for the first time on a turn or ends its turn there. The other side of the wall deals no damage.
—Wall of Fire, Player's Handbook, pg. 285
Character moves from A to D: 5d8 damage when they enter the wall
One side of the wall, selected by you when you cast this spell, deals 5d8 fire damage to each creature that ends its turn within 10 feet of that side or inside the wall. A creature takes the same damage when it enters the wall for the first time on a turn or ends its turn there. The other side of the wall deals no damage.
—Wall of Fire, Player's Handbook, pg. 285
Character moves from B to D: no damage
You didn't "enter" B, and there's no damage for "Entering" C, so ultimately, no damage is issued.
Character moves from C to B: 5d8 damage from entering the wall, 5d8 at the end of turn
Same as moving from A to B.
Other combinations
As far as I can tell, there's nothing surprising in any other set of movements. The rules for "entering" a zone only apply to B, and the direction otherwise doesn't matter. The rules for "ending turn" in a zone apply to both B and C, with slightly variant rules; but the order of entry doesn't matter for those rules.