In World 7-4 as Mini Mario, proceed through the level while staying on the left side unti you see a "?" box and a ledge. Jump on the box to the ledge, then jump out of the ledge while making sure to stay against the wall. You will reach a platform with a pipe leading to a red flagpole. You’ll unlock a 1-Up mushroom house to the north of World 7-4, which never disappears and thus can reach the maximum of 99 lives.