No, this is illegal: you must be paid for all hours worked up to the time you quit or resigned. If not, you could sue your employer for "breach of contract" (for violating the agreement, even if only an oral, or unwritten one, pursuant to which you worked those hours in exchange for a certain amount of pay). If the amount owed is less than the limit for small claims court, suing in small claims, as your own attorney or "pro se" to save on legal fees, is a very good option.