How long you spend at the mechanic depends on what your car needs. In some cases, you can expect to leave your car at the mechanic for days.
For example, if your car requires a lot of work, like an engine rebuild or significant body work, you shouldn’t be surprised if you don’t see it again for a fairly long time. Other times, one can expect to walk into the shop, get a diagnosis, and have it fixed in just a few hours.