Basic question: why do markets grow? I apologize if this is gonna be very basic, but I am a beginner. My question is: why do markets (expressed as indices) grow? Is it because money is constantly moved from the real economy into stock markets, but the ingoing flow surpasses the outgoing flow?

Suppose no money can flow in or out a market, besides what is already in. Would that market (or a stock index that represents that market) just reach a dynamical equilibrium? I would say yes, but please correct me.
The general answer is no, a closed market with only money circulating within the market, and that money never leaving it or entering it, cannot increase its aggregate price level - provided that the quantity of goods being sold on that market also remains constant. Price wise however, it can display variations over time, so share values can change - even if the money circulating that creates them doesn't.

The main reason market prices grow and shrink in the real world is that not only are new companies always being listed, but money is entering them and sometimes leaving them at different rates. In a typical western economy for example, the money supply is continuously growing due to bank lending, a percentage of that growth it being invested in the stock market through pension funds, and so there is a linkage between monetary growth and the market. 

Consequently any time some kind of conduit between lending and stock market purchases gets created, things tend to get exciting. cf. 1929 US Crash.