Yes, you employer can require you to remain at work until all work is completed, so long as doing so does not violate the terms of an employment contract or union agreement. The fact is that a company can set the conditions of the workplace much as it sees fit (absent some form of legally actionable discrimination). That having been said, you must be paid or all time worked, even if you have already clocked out (you should be allowed to clock back in).