There is no specific way to determine exact number of hidden layer , it may vary problem to problem so you can go for hit and try method for your problem.
A good measure is overfitting. The larger the number of layers and nodes, the more the overfitting. So, just increase the number of layers and nodes until overfitting appears. The point just before overfitting is the right size.
You can detect overfitting by comparing training and validation loss. If training loss goes down but validation loss goes up, then there is overfitting.
Actually, the number of layers and nodes are hyperparameters. So, by tuning them to reduce overfitting you are using overfitting as a measure to determine the size of the network.