Immunity is a statistic that affects your chance to be afflicted with a status ailment when hit with a debuffing projectile (such as the jinx shots used by the Shadow Shaman). It has no effect on the length of time that you are invulnerable after getting damaged, the duration of status ailments, or even on any other status ailments (such as "Slimed").
Your chance to be afflicted is calculated by comparing your immunity with a random number less than 10. If your immunity is less than the random number, you get the status ailment. If it is greater than or equal to the random number, then there is no effect. 
The following Footwear increases Immunity. The effect is constant while wearing the boots/shoes.
|Leather Boots||Defense (+1) Immunity (+1)|
|Rubber Boots||Immunity (+1)|
|Tundra Boots||Defense (+2) Immunity (+1)|
|Thermal Boots||Defense (+1) Immunity (+2)|
|Firewalker Boots||Defense (+3) Immunity (+3)|
|Space Boots||Defense (+4) Immunity (+4)|
|Cowboy Boots||Defense (+2) Immunity (+2)|
|Dark Boots||Defense (+4) Immunity (+2)|
|Genie Shoes||Defense (+1) Immunity (+6)|
|Skills & Stats|
|Skills||Farming • Mining • Foraging • Fishing • Combat|
|Stats||Attack • Crit. Power • Defense • Immunity • Luck • Magnetism • Speed • Weight|
- See DebuffingProjectile::behaviorOnCollisionWithPlayer in the game code.