The number of layers in a circuit board are determined by:
1. Are you going to control impedance? If so, then you need a continuous reference plane adjacent to the controlled impedance signal layer.
2. The number of layers should be even, and the core and prepreg dielectric thicknesses should be balanced. Odd number of layers, or unbalances thicknesses, in a stackup generally result in warping and/or cupping in the finished board.
3. Are there critical traces that need to be isolated from other signals? If so, you may need to dedicate a layer to them.
4. Are there multiple power supplies? If so, you may want to include a split power plane to distribute the power. The split plane should be adjacent to a continuous ground reference plane. High speed/critical signal traces should not be adjacent to the splits, because the return path will be interrupted.
5. Will the frequencies used tend to radiate from the board? If so, you may need to flood the outside layers with grounded copper. The signal layers would then be internal, and you would still need to consider 1-4 above.
As you can see, there is no cookbook answer - it depends on what you are trying to do (this is also called "engineering").