okay, certain things auto pin and certain things dont, to save time, rather than listing them all, heres the basics
if you WANT to pin something, select it on the game screen, be it a neutral grav well, enemy grav well, planet, structure, ship or pretty much anything that is selectable, and press the pin button.
some things are auto pinned, those are set in the settings (i think in the UI tab?). for instance you can set planets, fleets, cap ships etc to be auto pinned or not, whilst Starbases are automatically pinned (something that is unceasingly annoying on a map with lots of UCGW or frontline worlds)
basically go into the settings and choose what you want to be auto pinned and not, but if all youve done is press unpin on something in the game, it'll reset with a new game, so dont worry too much