What was the basis for deciding the size, shape, location and number of fins for the Saturn V (or any other rocket for that matter)? Does it have any calculations or were they designed based on empirical data / previous experience?
Center of Pressure
The most basic consideration for rocket fins is the center of pressure. This is basically the point along the rocket where the surface area of the rocket above and below are equal. For stable flight, you want the center of pressure to be well below the center of gravity.
An arrow is a good illustration: the metal/stone tip is heavy, bringing the center of gravity forward, and the fletchings add surface area to the other end of the arrow, pulling the center of pressure towards the rear. Since the center of gravity is well forward of the center of pressure, the arrow is stable and will fly true.
Thus the basic purpose of fins is to add surface area near the bottom of the rocket. This drives the size and location considerations.
Drag and Flow
Engineers will seek to minimize drag for efficiency sake (shape). They must also account for any maneuvers that might increase airflow along one side of the rocket, while lowering it on the other side (number) - the effective center of pressure changes if there is reduced air flow against the fin!
This is all complicated by the fact that fins can be used as control surfaces. I don't know how this influences the considerations exactly, but I'm confident that it does.
All of these design considerations are trade offs: the increasing performance in one metric impacts other metrics, often negatively. The specific end result is a balancing act between all the different needs of the rocket in question.