What do you call this feature where a search query gets converted to "tags" that has been popularised by Pinterest (but could also be seen in Google Drive, Facebook, Apple Mail etc) and what guidelines has been written about it?
I think they have been adopted from "Search Tokens" on OS X.
A unit that functions as a special, adjustable search term. Tokens are great because they make searching less error-prone and easier to manipulate.
The functionality is different as search tokens refine search to a specific field. However, it looks similar as far as UI is concerned.
More here - Improving file searches with search tokens
Search Token/Tags could be a good general name. But Google came with another one in its Material Design Components: Chips
It's usually referred to as 'Multi-select autocomplete' in my experience. I haven't seen any guidelines previously (or from searching now) but this demo and code link might help you in some way jQuery Tokeninput.
Its called as Tagging. Similar to this feature is a available in Mac OS (tagging while saving the files, it helps in searching/indexing files). Many site uses this features as you mentioned.
If you follow the patterns in the google, facebook or mac os, you will get the better idea about the tagging guidelines.