why is water retained in the jelly and does not flow out
The cell membrane separates the inner parts of a cell from its surroundings. It is selectively permeable meaning that certain substances pass in or out and others do not. This is due to size of the molecules, and the concentration gradient, outside vs. inside the cell. The membrane is a lipid bilayer with protein molecules in between. The cytoplasm contains mainly water with dissolved substances. The water you are referring to in your question does not flow out of a cell as long as there is an equilibrium on either side of the membrane. However, in a situation where there is a high amount of solute like salt outside of a cell relative to inside, the water inside the cell can pass through the cell membrane from high to low concentration, by outward osmosis. This is called plasmolysis and the cell shrinks and can die.