Both K and the equilibrium composition depend on temperature

For a reaction system at equilibrium, the equilibrium constant is related to the concentrations of reactants and products (equilibrium composition) as shown below. 

If aA + bB cC + dD
and A, B, C and D are substances that are all dissolved (solutes) or are all gases
where a, b, c and d are coefficients in the balanced equation
 
Kc =[C]c[D]d 
[A]a[B]b 
 reaction quotient

The magnitude of K depends on the temperature. If the temperature of a system at equilibrium is changed, the reaction quotient will no longer equal K, and reaction occurs to re-establish equilibrium. This results in a change in the equilibrium composition. 
 
If the reaction is endothermicH positive) K is larger at higher temperature.
Increasing T causes net reaction to form products until the expression above is equal to the new K at the higher temperature.

If the reaction is exothermicH negative), K is smaller at higher temperatures.
Increasing T causes net reaction to form reactants until the expression above is equal to the new K at the lower temperature.

Thus the equilibrium composition depends on the temperature because the magnitude of the equilibrium constant depends on the temperature.