So it depends on two things
1) How much time was needed to find a block (more time means usually more transactions)
2) How much transactions were made during that time (of course more transactions means more transactions)
Actually, you're only partially correct.
A miner (or mining pool) that creates a block obviously can't include transactions that don't exist. Therefore, the maximum number of transactions that can be included in the block is the number of unconfirmed transactions that the miner is aware of when he creates the block.
However, a miner (or mining pool) is not forced by the protocol to include all transactions if they don't want to. The miner (or mining pool) is free to use whatever criteria they like to choose which transactions they want to include in their block.
Since miners (or mining pools) get to keep the transaction fees from all the transactions that they include in their block, there's a financial incentive to include the transactions that pay the highest fees. In particular, since the size of a block is limited to a 1 megabyte maximum, there's a financial incentive for the miner to include the transactions that pay the highest fee per byte.
Some miners (or mining pools) are concerned that their block might get orphaned if their block is significantly larger than a competitor's block. Therefore some miners (or mining pools) restrict their blocks to be smaller than 1 megabyte.
Some miners (or mining pools) prefer not to include any free transactions at all (since they won't get paid for including them). Other miners feel that including some free transactions makes the entire system (and therefore their mined bitcoins) more valuable. Therefore, they are willing to include a limited number of free transactions in the blocks that they mine.
There are even some miners (or mining pools) that don't want to be bothered including transactions in their blocks at all. They just mine empty blocks where the only transaction is the one that pays them their block reward. This is allowed by the protocol, because it is assumed that the financial incentive of increased profits will motivate enough miners to include transactions. The few miners (or pools) that mine empty blocks are simply leaving money (and profits) behind that the next miner will get to take in the next block.