I would say no, they are not kept there for the entire project. Each trade comes in as their part of the project is ready to be worked on and then leaves.
If the foundation diggers stayed around and electricians stayed around while the plumbers worked, and if the foundation guys, electricians and plumbers stuck around while the painters worked, it would get very crowded with little room to do the work.
They all come and go as each phase of the project is completed. That's the role of the general contractor, to coordinate all the different tradespeople so they aren't working on top of each other.