Doubt about layers and perceptrons

Sir , how do we decide that how many layers we have to construct and how many perceptron each layer have ? In this video sir , told that there is 2 layers and 4,3 perceptrons respectively . But how do i decide , how many layers and perceptrons i have to keep ?
Please reply .