The title chief of staff (or head of staff) identifies the leader of a complex organization such as the armed forces, institution, or body of persons and it also may identify a principal staff officer (PSO), who is the coordinator of the supporting staff or a primary aide-de-camp to an important individual, such as a president, or a senior military officer, or leader of a large organization.
The chief of staff generally works behind the scenes to solve problems, mediate disputes, and deal with issues before they are brought to the chief executive.
[1] Often chiefs of staff act as a confidant and advisor to the chief executive, acting as a sounding board for ideas.
Ultimately the actual duties depend on the position and the people involved.
[1] In general, the positions listed below are not "chiefs of staff" as defined at the top of this page; they are the heads of the various forces/commands and tend to have subordinates that fulfill the "chief of staff" roles.