A near return pops one word into IP. A far return pops IP and then CS, undoing the two pushes of a far CALL. With an operand, RET n first pops the return address and then adds n to SP, throwing away n bytes of arguments the caller pushed before the CALL. n counts bytes, so two word arguments need RET 4. No flags change.

FormEncodingPops
RET (near)C3hIP
RET n (near)C2h + 16-bit nIP, then SP + n
RETFCBhIP, CS
RETF nCAh + 16-bit nIP, CS, then SP + n

Inside a PROC, MASM turns RET into the near or far form to match the procedure's distance. RETN and RETF always mean what they say. The Pascal convention lets the callee remove its arguments with RET n:

MOV AX, 3
PUSH AX ; one word argument
CALL TRIPLE1 ; returns AX = 9; RET 2 removed the argument
ADD AL, "0" ; digit -> character
MOV DL, AL
MOV AH, 02h ; DOS: print the character in DL
INT 21h
TRIPLE1 PROC NEAR
PUSH BP
MOV BP, SP
MOV AX, [BP+4] ; the argument
ADD AX, AX
ADD AX, [BP+4] ; 3 times it
POP BP
RET 2 ; pop IP, then SP + 2
TRIPLE1 ENDP

RETF pops whatever is on the stack, which allows a trick: push CS yourself, then make a near CALL, and the stack holds the CS:IP pair a far return expects. Handy in a .COM program, which cannot link a far CALL to its own code:

Prints 5.
PUSH CS ; a far return address by hand: CS first...
CALL FARSUB1 ; ...then the near CALL pushes IP
ADD AL, "0" ; digit -> character
MOV DL, AL
MOV AH, 02h ; DOS: print the character in DL
INT 21h
FARSUB1 PROC NEAR
MOV AL, 5
RETF ; pops IP, then CS
FARSUB1 ENDP

Pitfalls

If SP is not where it was at entry, RET pops a wrong address. A far return from a near call (or the reverse) unbalances the stack by one word. In 32-bit code on the 386 and later, returns pop 4-byte offsets.