After pocketing the last ball, the cue ball bounces back to pot the 8 ball, leaving my opponent with 4 object balls. In this situation, who is considered to be the winner? Is it the the opponent or me, because he is remaining with 4 balls not potted.
In standard BCA ruling (Billiards Congress of America), this would be a loss. If at any time you pocket the 8-ball, before the rest of your 7 object balls (solids/stripes), or during the shot on your last object ball, the game would end. The cue-ball must come to a stop after your last object ball has dropped before you can take a legal shot at the 8-ball.
In your scenario, your score would be 7 (one for each object ball dropped), your opponents score would be 10. Winner always receives 10pts, even if they have object balls left on table (i.e. you accidentally drop the 8-ball early)