It usually takes 3 - 6 months to build everything from scratch.
The time goes into backend development, security, UI design, testing, deployment.
If you don't have enough time to build everything from scratch, there is also another option available for this case. That is white label solutions, you can get within 7 days.
Want to know the exact timeline? Check this blog on online about Time takes to develop a crypto exchange