A wing creates aerodynamic downforce; a spoiler disrupts airflow to reduce lift. The terms are often used interchangeably but refer to different aerodynamic functions.
Wing and spoiler are different aerodynamic devices despite often being used interchangeably. A wing is a fully developed aerodynamic surface (typically with an airfoil cross-section) designed to generate downforce by deflecting air upward. A spoiler is a simpler shape (often just a raised lip or panel) designed to disrupt high-pressure airflow and reduce lift on the car body, but generates little to no downforce itself.
Wings are more effective for serious downforce generation. The free-standing rear wing on a Porsche 911 GT3 RS, the swan-neck wing on the Lamborghini Huracan STO, or the high-mounted wing on a Civic Type R are all designed to generate measurable downforce at speed. Wings can be adjusted (angle of attack changes) to optimize for different track conditions.
Spoilers are common on production cars for cosmetic and lift-reduction purposes. The trunk-lid spoiler on most modern sport sedans or the integrated rear spoiler on a Toyota Camry hybrid are examples. They reduce lift slightly and improve the visual silhouette of the car but do not generate significant downforce.