WASHINGTON—Vice President Joe Biden’s son Hunter was discharged from the Navy Reserve this year after testing positive for cocaine, according to people familiar with the matter.

Hunter Biden, a lawyer by training who is now a managing partner at an investment company, had been commissioned as an ensign in the Navy Reserve, a part-time position. But after failing a drug test last year, his brief military career ended.