Sounds like that the person setting the time frame does not program.
Do you have a process?
Ours is as follows.
Exploration: (is it something we can do? Usually a very short time)
Requirement Analysis: (Figuring out what your client wants and document it. Depending on the size of the project this could take a couple of hours to a couple of days. Once you and your client agrees on the requirements you get them to sign the document. This is a good area to figure out how long various task will take.)
Design: (User interface look and feel. Get client approval. Milestone)
Development: (The grunt work. Coding)
Testing (Alpha and Beta testing. You'll need a group of testers from the target users to perform the test. It is ususally a good idea to give them a script to follow so they will test all functions. After testing is complete, get client approval)
Production: (moving the finished project into the live enviroment)
In our case there is also a Change Management process we need to follow and get approvals on from the enterprise to get projects into production. (That is about a week)
On each section you determine time lines.
Check out this
Link. Dev Shed has a 5 part article that explains the process very well. I used that resource in developing our process.
Good luck!