Brewing is an art, not an exact science. You have your beer in a container we would call a fermenter. You should know roughly how much it can hold and how much you really have in there, an estimate. If you are off by half a gallon it won't be a big problem, you just add the amount of priming sugar required for the amount you think you have and then you mark your fermenter with something to indicate just how much it will hold at various locations, like one mark per gallon before you brew again.
You should dissolve the priming sugar (weighed, not measured) in about a pint of boiling water. I usually start the racking of the beer before I pour the sugar solution in as I seem to get better mixing that way. When the beer is all racked into the bottling bucket use a sanitized spoon (as long a one as you have) to gently stir (so you don't mix in oxygen into the beer) the beer and sugar mixture.