How do you know how many layers your Model needs?

Hi there,
I am new to the space and I was watching 3Blue1Browns Series on Neural Networks (I can highly recommend them btw). While watching his series I was wondering how Devs know/calculate how many different layers they need for their model. Is the number of layers dependent on how many different data points you have or can you calculate them differently? I guess the number of layers also depends on your compute power? Would love to hear your thoughts on this.