How to estimate the development of a website or an app

When we estimate a development project we need to get two numbers. The first one is the number of days or months needed to complete the project. The second one is a budget to pay the development team for their work. What is behind these two numbers?