What pump are you replacing it with? Easiest would be to just unscrew the coupling to the pump and replace with a like pump. Or if there is nothing wrong with the wet end, just replace the motor and leave the plumbing alone.
To know where to cut, kind of depends on where the new pumps connections are located ... and how they attach. If they are not the union design, then it is a little more tricky.
Usually you would want to start by leaving as much pipe as possible when you cut. Then make adjustments are required. For example, on the suction side, you might end up having to cut the pipe in the middle to find a coupler and then add another short piece of pipe to have enough length to the new fitting such that hopefully the pressure side mount lines up.