How can I rotate an object with certain degrees?

I tried to rotate using;

Object.gameObject.transform.Rotate(new Vector(x,y,z));

and

Object.gameObject.transform.Rotate(x,y,z);

but whenever I use them object keeps rotating?

Every time you execute the transform.Rotate() method, the object will rotate by the degrees around the given axis either in World or Local space. See the following manual page:

http://unity3d.com/support/documentation/ScriptReference/Transform.Rotate.html

The rotation will occur each and every time you call the function/method. If you are calling it within an Update() function, then it will rotate each and every frame. If you are not calling these statements directly in an Update check that you aren’t calling them in a function which is itself called during the Update function. If you still are finding that the object is rotating and you are sure that you are not in an Update(), comment out the Rotate commands with the “//” comment code and run again. See if the object continues to rotate. It may be you have an animation associated with your object which automatically plays which includes rotation and the rotation has nothing to do with these exact statements.

Rotate_flag = false;
if(Rotate_flag)
// rotate

That should do it. And then just change the flag whenever you want it to rotate