This can be done as long as the gel remains under buffer or distilled water, however there can be some diffusion of the DNA in the gel, so visualizing your samples immediately will give clearer, sharper bands.