The Lava Charm grants your character immunity to lava for 10 seconds. When you have this item in your inventory a new bar will appear above your armor bar. When your player comes into contact with lava that bar will begin fading away. Once its completely empty the lava immunity will vanish and you will get lava damage again. Once you leave the lava the bar will start to slowly refill. You can find lava charms in dungeon chests but they have a higher chance of spawning in chests from nether fortresses.
When you have Baubles installed you can also equip this as a ring instead of having it in your inventory
Note that the Lava Charm does not safe you from being set on fire in the lava, if you want to take NO damage in lava you also need an Obsidian Skull.