What is the largest gain configurable with an opamp?
Short:  

No!!!!

Longer:

Without a very specific description of a real world requirement this sort of question is useful at best as a thought experiment.

Single stage:

So - yes - it can be configured, but it would not be useful.
Without looking it up - 10^6 gain = 120 dB which would be in excess of the open loop gain.  A bad start.  

With an input offset voltage of say 10 mV the output would be typically at 5,000,000 x 10 mV = 50,000 V - were it not for the "rather lower" maximum power supply voltage. 

To zero trim the output to within a volt of ground you'd need a trimming accuracy of 1V/E7 = 0.1 uV. "Not easy".  

Input bias current would "cause problems".  Big ones.

So, no, that is vastly beyond what can be achieved in real world applications with that class of equipment. And most other classes too.

Multiple stages:

For a gain of 100 per stage you'd notionally need only 4 stages.  

100 x 100 x 100 x 5 = 5,000,000  

If these were DC coupled you could trim each stage to within practical limits, but stability would be terrible, and noise (thermal and other) in the early stages would be amplified and dominate the output. 

eg for a say 10V output swing input would be 10/5E6 or about 2 uV.
An LM358n / LM324 is a terribel choice for this. There ARE opamps that are designed for use in systems which have very high gain and ultra low noise and which are relatively impervious to offset error conditions. (eg chopper stabilised systems). But they are "in a different world" to the LM358. 

Why?
If you have a well described example, an answer of what may work may be forthcoming.