It depends. Sometimes I get an idea which I can immediately check by looking at some data I have. Some theories take much longer to prove. Fermat’s last theorum, for example, took over 350 years to prove!
In science, we can never truly prove that a theory is true – all we can do is continually test it against experiments and observations. That is one of the beauties of science, that we are always trying to see where our theories fall down.
To address to question of how long it would take for a scientific theory to be ‘proven’ – the real detail comes down to the fact that the use of the word theory in science is very different to its use in everyday language. In everyday language, we have ‘theories’ about everything. It is used in the context of a hunch, or a vague idea about how things are linked. In science, though, theory is used in a stronger, more well defined sense.
A scientific theory, for example the theory of evolution by natural selection, is a framework into which observational scientific evidence can fit. It is a comprehensive explanation of some phenomenon which is supported by facts gathered over time. Theories survive or die based on their ability to fit in with the scientific evidence. If new evidence is found, and the theory cannot explain it without radical rehauling, then it falls by the wayside in place of a stronger theory (if there is one).
So, ‘proving’ a theory is, in a sense, already partially done in science – the real test is finding out how long it fits in with the evidence.