This is a big question! Just some factors which must be considered are size, what good or service the organization offers and the level of complexity of that good or service, geography, the organization's market, and management style.
A very small company can often have a "flat" and informal structure and should, because having a formal and layered structure can create unnecessary expense and communication barriers. A larger company might be organized in a more formal way, depending on the nature of its business.
If there is complexity in the operation of creating a larger company's good or service, often there is a need for structural organization, with departments that have specific responsibilities, for example, marketing, operations, and human resources. Another form that is becoming more popular is the "matrix" organization, with work groups comprising a mixture of employees, often assigned to a specific task, for example a group of engineers and marketing people.
An organization that is more geographically far-flung might organize geographically, giving each geographic site more site-based autonomy, with a barebones central operation.
No matter what the size of the company, the personality and management style of owners/managers can be a factor. Some people are uncomfortable with a flat organization, with its attendant informality, while others are uncomfortable ceding authority to site-based management.
This is an important aspect of an organization, since decision-making, communication, and cooperation are all strongly affected by structure. It is remarkable how often this part of running an organization is not considered.
There are a number of factors that must be considered.
First, it is necessary to consider whether a firm would be best served by a vertical or a more horizontal organizational structure. For this, you have to think about whether you want your workers to have a great deal of input into the firm’s practices. A more vertical structure tends to be more hierarchical and rigid. A more horizontal structure allows more input from more people. It is more appropriate if you have a good workforce that can be trusted to make decisions.
If you choose a more hierarchical structure, you have to decide about how to split up your departments. There are a number of ways to do this. Departmentalization can be done based on
Function. You would have a marketing department, a purchasing department, and others.
Product. Each major product or product line has its own department.
Customer. Here, you would have different departments for selling to large and small businesses, for example.