Ctrl-# will overwrite that # with currently selected ships.
Ctrl-Shift-# will add currently selected ships to that group # (leaving ships already in that # still there).
Ctrl-Alt-# will remove them from that group # (and you can delete a group entirely this way).
Ctrl-x-# will assign the currently selected ships to # and remove them from all other groups (as near as I can tell).
Other useful tidbits about groups, while I'm at it:
Hitting the # once selects the group (changing your currently viewed system if there are no group members in system).
Hitting it twice selects it and centers screen on the midpoint of the group.
Hitting it three times will select and center on any members of your group in a different system (useful for cycling through and figuring out where stragglers are sometimes).
You can also assign Docks/Fabricators/etc to groups, but this is slightly different than some other RTS's where you can then hit that # to select those buildings. I mean, yes you can do that, but if you add any non-military units to the group, it will default to selecting them instead. What you can do that I find useful is Ctrl-Shift-# whichever building(s) you want, and then any units built from there will be assigned to that group automatically. I generally pick one number and leave it reserved for this purpose, assigning every production building to that group; what this leaves me with is a hotkey for select-all-units-in-system (yes, I know that's already a hotkey), and for cycle-through-all-systems-with-units, and other general goodness. You can assign a building to multiple groups. This helps because in addition to having my one super-group, I may early on have a dock building, e.g. only scouts. Then I have hotkey for select-all-scouts (yes, I realize that's already a hotkey too), and cycle through systems with scouts... anyway, just sayin'.