The goblin is a creature of the Gloom. While there's a goblin on your lands you can't do actions around him (including designing actions). In order to banish a Gloom goblin you need to hit him nine times, each time costs one energy. Once the goblin is gone you can continue do what ever you like, as long as there are no more beasties on your land.
A goblin might appear while collecting stone starting from level 21. Sometimes, goblins appear in groups as part of a questline.