Hatless Super Mario and little Mario with hat
Once you've reached the maximum number of lives(which is 1,110, displayed by a triple-crown), any time you're in Super Mario(or Luigi) form you'll be without your hat, and vice versa when you're little Mario(Luigi). Note: this doesn't apply to any other form than Super, ie. Fire, Tanooki, Boomerang, etc. This includes the opening demo and "demo room"(when you leave the game untouched for a couple of moments at the title screen).