When is a hypothesis developed in the scientific method?

after an experiment

if the experiment justifies one


before there is a question

after a question has been identified and observations are made