It's variable. Each miner decides (in software) which transactions to include in a block.
Everything is in here: https://en.bitcoin.it/wiki/Protocol_specification
Or read the source code for the standard client: https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp