how do i make motors run for a set amount of time

Have you looked at blink without delay?
You should.

Please, please, please, use code tags.