Temperature is the quantity that tells you which way energy will flow when two systems are put into contact with each other. (Energy flows from the system with the higher temperature to the system with the lower temperature).
Let Ω be the number of accessible states. (This is the number of states that the system can change into from its current state). The
entropy of the system is defined as the logarithm of the number of accessible states, times a constant: S=k
B log Ω. The reason for the logarithm in the definition is that if system 1 has Ω
1 accessible states and system 2 has Ω
2 accessible states, the combined system has Ω
1Ω
2 accessible states, so the entropy of the combined system is
S_{\text{tot}}=k_B\log(\Omega_1\Omega_2)=k_B\log\Omega_1+k_B\log\Omega_2=S_1+S_2
The logarithm is what makes entropy an additive quantity. The constant (which is called
Boltzmann's constant) is irrelevant to what I'm saying in this post.
__________________________________________________
Edit 2: I deleted what I wrote here, because one detail looked wrong to me, and I said it better in
this old post anyway.
__________________________________________________
Note that a system must have time to settle to an equilibrium state before the temperature is well-defined. When two systems with different temperatures are put into contact, the temperature of the combined system isn't well-defined until energy has stopped flowing from one the systems to the other.
Edit: The wikipedia article includes my definition, what vlado said, and a section on negative temperatures.
http://en.wikipedia.org/wiki/Temperature