Is it legal for a manager to clock you out before you're finished and make you work for free?

No, it is not. For example; Wal-Mart recently lost a big lawsuit over exactly this type of unlawful activity.