The part of the keys you play on varies. The music will frequently be the deciding factor, and the hand follows to play in the most ergonomic manner what the music asks.
As a general rule, a good starting place is to visualize a line across the keyboard, at the tips of the black keys. Placing the hand along that line is often the most efficient manner of reaching both white and black keys while minimizing in and out movements. A good example of this in use is playing chromatic octaves. In order for this to be successfully employed in playing one must always keep in mind it is a generalization, and the rule is supposed to be bent or broken when there is a more ergonomic solution available.
Somewhat related to the above guideline, is Chopin's teaching on hand formation:
Place the fingers on E, F#, G#, A#, B.
Of course the hand is not to remain static in this position, it is meant to move when playing music.
Chopin had his students begin with the B major scale, as he taught that it puts the hand at ease.
There is also a method that proposes that the optimal control of a key can be achieved by playing closer to the edge. From a physics standpoint this means one is maximizing the length of the key as a lever. However, the downside to this approach is that playing near the edge of the keys, especially the white keys, is not the most ergonomic and efficient use of the hand. Again a generalization, one should not rigidly adhere to this position. It is probably the most effective when the hand plays single note melodies, and one is after utmost tonal control. It is probably least effective for playing fast passage work.
Chords often need some fingers to be placed between the black keys, to achieve optimal hand ergonomics. For example, D major chord with its inversions.
Although the above is a small sampling of techniques, it illustrates different playing situations can call for different placement of the fingers on the keys.