Play a level that contains a 1-Up, such as Bomb-Omb Battlefield. Collect the 1-Up mushrooms, leave the level, then go back in and repeat as many times as desired.
You must have at least 8 Stars and Mario unlocked. Go to the area where you unlocked Mario as Mario and go down the tree stump to fight Goomboss. Kick the back of his head to get the mushroom. Eat it and wait for him to turn and create three Goombas at a time. Because you are big, you will automatically kill them. Keep standing there and you will start racking up lives. You can get up to fifteen lives at a time this way. Once the mushroom wears off, kill yourself and jump back in. Repeat the process.
Go up to the room with each character's door. and find the stained-glass portrait of Princess Peach. Jump into the portrait on the right hand side to access a Secret Star room. Go down the slide in front of you and, about halfway down, you will run into a 1-Up. Repeat this as many times as needed.
If you die during the final battle and need more lives, go behind the pillar to your left to find a 1-Up. Each time you die against Bowser, the 1-Up will be there again.