How to make my potentiometer work only when push button is held down?

Well you haven't written any code that says to turn it off. So you want: If the buttonState is LOW turn it on (you have that) else turn it off? That literally translates directly from english to code.

What do you mean you don't know what the input is? You wrote it in the code? An input is a pin where you are reading a voltage? Like pin 13. See the pinMode call? You wrote it. How can you miss it?

What is a pull-up? It's something you really need to know about. Here, check this link. Gammon Forum : Electronics : Microprocessors : Switches tutorial