How do I make sure that no one can log in or sign up

How do I make sure that no one can log in or sign up to the chat when i don't want them too. I want to only open it when there is a moderator around so need to fix the times. How do I do that, or how do I lock it down manually?