The number of layers you can have in a file is determined by your device’s specifications, version of the operating system, and available memory.
NOTE: memory (RAM) and storage are different factors. Storage is the space available on the device to save files. Memory is the processing power that the device has.
Available memory is reduced when multiple apps are running at the same time. The operating system also uses memory. A device with 8GB of RAM is will not (and cannot) make all that memory available to Sketchbook.
When working with large canvases it is a good idea to reduce the number of other apps running in the background.
For better performance and more available layers, do not create bigger canvases than you really need. A smaller canvas will increase the number of layers available, due to the reduced demands placed on your device.