Once it is closed, it will stay closed until the Player takes out the two screws on the door's hinges. Once this happens, the door will slowly fall over until it hits the floor, creating a large amount of noise which alerts Granny. However, Granny has already been alerted by the Security Camera, so the Player will have to act fast.
Break the Security Camera with the Hammer before entering the Jail. This prevents the door from closing. If Granny is coming and the Player is still on the Jail side of the Attic, they can crouch and hide behind the Wheelchair in the corner.