gconf-editor
Extend the follow path
/ > apps > metacity > general
Then select button_layout
Modify the value of button layout, type
menu:minimize,maximize,close
The : (colon) which separate the button layout located on left hand side or right hand side.
The , (comma) which split the button layout one by one.
Then press OK
Finally, the button layout move to the right hand side
Also, there is a very simple way to set the button layout on terminal
Type
gconftool-2 --set /apps/metacity/general/button_layout --type string menu:minimize,maximize,close
It is as same as the GUI settings