Remember that pH is defined in terms of the concentration of hydrogen ions in the aqueous solution. If a solution contains a strong alkali [such as KOH] the concentration of hydroxide ions will be the same as that of the solute. The corresponding [H+(aq)] may then be found by utilising the ionic product of water, which happens to have a value of 1 x 10-14 mol2 dm-6 at 298K. Knowing the value of the product of two ionic concentartions, and one of those, enables the evaluation of the other...hence the pH.
The value of Kw is temperature dependent, becoming larger with an increase in temperature. This is a consequence of its definition, and of the fact that the dissociation of water to which it relates is an endothermic process.
If you are asked to complete calculations at a different temperature, then the value of Kw would be given.