The number of units in the hidden layer is ussually determined by empirical derived rules.
Jeff Heaton has a section about the number of units in the hidden layer in the publicly available book "Introduction to Neural Networks for Java, Second Edition".
Generally speaking the numebr of units in the hidden layer should be kept as small as possible.