Halloween props

I need a way for a pir sensor to turn on my arduino program and then stop after a period of time amd then have it off until uts trihgered again. I have tried but I could only make my relays pause in the middle instead of turning on the program letting it run for a period of time then stop
I am trying this for a Halloween prop. I

I am new at this if needed I can post my program