Night 11, it's the busiest night before Ari turns from green to red and trades mechanics to take up all your attention. Although night 12 with red Ari can still see Maddie enter your doorway.
Note that she does not make you lose the game with a jumpscare in this current Unity build. However a video I found online (if legitimate) hints that she might defeat the player with some kind of haunted gift totem. I don't intend to look for the video and the game's content has changed much so let us leave speculation behind and see the next actual release in earnest.
Also: once you keep your sanity high and avoid lowering it by not overusing your doors and fixing the pink gas valve and cleaning robot when they go down, you really very literally ignore green Ari. Even when she appears in your doorway, a pursuer at the window can't enter your door when Ari is standing in the doorway, but they can enter by the door the moment Ari leaves your doorway. Simply put, Ari is a fake threat until your sanity is too low, then she can attack.