Yes, this is part of the GM's role.
Adjudicating the actions of non-player characters, including (but not limited to) hostile NPCs, is one of the primary jobs of the DM. This is also mentioned in the Combat chapters of the PHB (p. 189) or the Player's Basic Rules (p. 69):
The Dungeon Master controls all the monsters and nonplayer characters involved in combat, and each other player controls an adventurer.
How do I do that?
The DM is basically free to choose whatever he wants the NPCs to do. In your goblin example, the goblins could gang up on the wizard, or just flail wildly at whatever is closest/looks most edible.
However, there are several restrictions as to what you can/should do, because of several reasons, such as your/your groups playstyle, or the shared fiction you create as a role-playing group.
For example, a bunch of four goblins rushing past the fighter and the rogue to gang up on a wizard for no other reason than that he's
wearing a dress obviously a wizard would probably raise eyebrows in a normal game, because it does not fit into a regular goblin group's character (Even though it's a valid tactic for smarter enemies). This is an example of being restricted by fiction. Note that these restrictions never apply "globally", since they are based on the fiction.
As to attacking unconscious characters, this brings me to playstyle restrictions. In many groups, this is not done based on mutual agreement. If you as a group like to play for the challenge and like high risk games, then it may become a very valid choice for the goblins (though fictional restrictions can still apply). In this regard, you might want to check out the same page tool, which is designed to (you guessed it) bring everyone to the same page as to what will go on at your table.