I need to stop a rotation

I need to stop a rotation of an object after a certain amount of turns or after a certain amount of time. I can get it to rotate just fine when I press a go button, but not sure how to make it stop without have to press a stop button. Can i add some script to make it stop after a certain amount of time or a certain amount of rotations. This is the code I am using for the spin. Thanks.

var speedforChange: int;

function Update () {

    amtToMove = speedforChange * Time.deltaTime;
    if(ControlScript.triggerGo == 1){

    transform.Rotate(0, speedforChange*Time.deltaTime,0);
    }

}

You can check for the amount rotated or the time elapsed in the if statement

private var totalAmtMoved;

function Update()
{
   // snipped...

   if (ControlScript.triggerGo == 1 && totalAmtMoved < 30)
   {
      transform.Rotate(0, speedforChange*Time.deltaTime,0);
      totalAmtMoved += amtToMove;

   }
}

You can use the same logic to check for time.

If the object is a rigidbody you can also simply set the angular drag which is the drag on an object as its rotating. do this in the inspector under the rigidbody settings.