3 black wires to new dimmer switch
Are there some white wires in the back of the box?  If so, surely the blacks are: 


One black (and partner neutral) which comes from power source.  It will be hot all the time, even when separated from the others. 
One black (and partner white) going to other things such as receptacles, light switches and the like, things intended to be always-hot. 
One black (and its partner white) going to the lamp - the one controlled by the switch. If you wire power source to this, the lamp will be on all the time. 


The normal connection is to a) hook up all grounds.    b) attach the black/hot going to the lamp, to one of the switch terminals.  c) tie the power-source and the "other stuff" hot to each other.  d) Tie those two to the other terminal on the switch. 

How to tie 2 wires to one terminal