when the folder is listed in Frequent list
Right click the folder icon in taskbar to see the jump list. This jump list will show frequently visited folder and pinned folders. If the folder you want to pin is listed in frequently visited list, simply click the pin icon of that folder.
when the folder is not listed in Frequent list
But how to pin when the folder you want to pin is NOT listed in frequently visited list. Open that folder. Now drag the folder icon from address bar to the folder/ explorer icon in taskbar. This pins the folder to the Jump List of explorer / folder.