You only gain experience at the end of a game. There are two ways for this to happen.
The first, and most common way, is to die. Fortunately, you don't need to worry about killing yourself to unlock a new character- thanks to the spiders, hounds, cold and, of course, starving, dying will happen on its own.
The second is difficult and more complicated but it is one of the things which could be considered "winning":
During your travels, you will find Things. These Things appear useless but are actually used to assemble the Teleportato. There are five Things in total- four items (Ring Thing, Crank Thing, Box Thing and Metal Potato Thing) and a structure- the Wooden Thing. Attaching all four Things to the Wooden Thing will allow you to start a new game, keeping your inventory.
Doing this will earn you experience and will allow to to use a character unlocked with it.