Factors affecting the project schedule are:
- Resource availability: The less resources allocated to the project, the lengthier the project schedule is.
- Project complexity: If the project has complex and never undertaken tasks, then surely the project manager must accommodate that fact in his project schedule.
- Task dependencies: There are many tasks that cannot be started before others are finished, there are also some tasks that have to start together. Tasks dependencies will dictate the sequence of tasks and will also dictate the project's need for resources at any one point.
- Team experience: If the project team is weak or has no experience on similar projects, then the project manager must account for that in his project schedule and must pad his estimates.
- Deadline: Quite often, the stakeholders impose a specific deadline (for example, we need the project to be finished on November to be able to Launch on Christmas or New Year). A "hard" deadline will great affect the project schedule, as the project manager will probably over-allocate resources and will also probably make them work on weekends and holidays in order to meet the deadline.
- Project priority: If the project has low priority in the company, then the project manager will not be able to claim the resources he really needs to finish the project in a condensed timeframe, he will only get a fraction of his needs, as most resources will be assigned to high priority projects.
- Material availability: For example, in a construction project, you need sand, but the sand is not available until the third month of the project, so the project manager needs to create the project schedule accordingly and ensure that there are no idle resources waiting for the sand to arrive in these first 3 months.
I'm sure there's more, so, for anyone (who's a project manager) reading my answer, please feel free to contribute if you can think of other factors affecting the project schedule.