No requirement on beating a certain number of levels or anything- as long as you have a controller connected you can add a 2nd player from anywhere in the game (though if you’re mid-puzzle player 2 will not appear until you restart the puzzle). If you have p1 assigned to a controller or keyboard, if you connect another controller and open the overworld menu you can add one there (it’ll show all controllers connected and let you assign with left/right), or you can press select on the xinput controller you’d like to assign and press right to assign it to player 2
That's the weird thing, though; I had a gamepad connected and P1 was assigned to the keyboard and there was no evidence of P2 existing nor being able to control it. I guess I'll try a disconnect and reconnect later.
Did you press the select button on the unassigned controller and press right on it to assign it to P2? As long as the gamepad is an xinput device (0-3 gamepad ID range) the game will sniff for inputs to assign it from either the overworld menu or from the little widget that pops up if you press select on the controller