If we consider |W| as set of all strings over {0,1} then the condition that should be followed is |w| =0 mod n ac to question.
Here we are considering binary no .So in case of binary no if we divide any no with base of number which is 2 in case of binary then max remainder we can are either 0 or 1 (if we generalize it like if base is n then no of state we should consider is n-1)
if we take it up to n then max remainder we can get is {0 ,1 ,2 ,......n-i } which is n.
This is the reason we got n states here.