Basically, a headshot identifies the subject, where a portrait tells the viewer something about the subject. For example, the photo used on a school identification badge of a student is a headshot identifying the subject. A photo of a high school athlete in his lacrosse uniform surrounded by all the trophies he has won over the years accompanying a newspaper article is a portrait. An actress has a headshot she sends before auditioning for a job, so the casting agency knows what she looks like. But that same actress also has a portrait of her in her home showing her on set of her first major television gig, in full makeup and dress.
Headshots are used for purposes such as business cards, advertisements, auditions, identification badges, website profiles, social media profiles or as other means of identification.
Portraits are used in editorial news stories about the subject, in lifestyle advertisements, on book jackets, in blog posts, as social media posts, or as framed art on the wall.