A rim is an edge. The rim of a mug is where you put your mouth to drink hot chocolate, and the rim holding a basketball net is where you're aiming when you shoot the ball.
People often use the word rim for the lip of a cup or bowl. You can also use the word rim for the circle at the top of a basketball hoop. There's also the rim of a wheel — the part the tire is attached to — and the rim of your eyeglasses. Rim comes from the Old English rima, "edge," which appears in the Old English word særima, "seashore," or "rim of the sea."