When Alice says that she wishes she could shut up like a telescope—meaning that she wishes she could be folded down into a very small space, the way a telescope can be folded down to a small size for transportation—she has a very specific reason for saying this. At this point, Alice has spotted a very small door, about the size of a rat hole, and through the hole she can see "beds of bright flowers" and cool fountains. All in all, it looks a very attractive garden, but Alice finds that she cannot even fit her head through the small door. As such, she has no chance of ever reaching the garden. Theoretically, if she could compress herself into a very small space the way a telescope does, she could pass through the door and then unfold herself again in the garden.
Alice, in the end, is unable to find a "book of rules" for telescoping in this fashion, but she does find a bottle with the words "DRINK ME" written on it. Subsequently, she is interested to find that she begins shrinking down to a very tiny size indeed, and she is able to comfortably fit through the door.