How do i change a computers screen res to be 1024x768 so my graphic will fit the screen?

if possible can i change it back to what it was before the program was opened when it is exited?