One common approach in statistics and certain experimental fields (like psychology) is to distinguish exploratory and confirmatory research. Exploratory research is open-ended; you can go in with some hunches or vague questions that shape what you'll look for, but you don't have a specific hypothesis. Confirmatory research starts with a specific hypothesis, and is designed to rigorously test that hypothesis. The two kinds of research involve different methods — exploratory data analysis for exploratory research; experimental design and statistical hypothesis testing for confirmatory research. This distinction is very similar to the old philosophy of science distinction between "the context of discovery" and "the context of justification", though I'm not sure whether there's a genealogical relationship.
Exploratory research is flexible and open-ended, but cannot claim to have "shown" or "proved" anything. That requires the rigor of formulating a specific hypothesis, designing an experiment and analysis plan, and only then collecting data. Using the same data to both develop a hypothesis and claim that you've confirmed it is sometimes called Hypothesizing After Results are Known, or HARKing (sorry for the paywall), and in the context of statistical hypothesis testing it produces incorrect inferences.
The exploratory/confirmatory distinction doesn't apply to all fields of scientific research; it only really fits experimental research, where in principle you can conduct carefully controlled, repeatable studies to collect more data.