How are the prices of stocks determined

How do market mechanisms decide the prices of stocks?