How to modify the below code that the motor works (Turns on) for tamount of time

Please post the whole program as it is now