I notice that when guys hug, they usually give loose 'brohugs' and/or 'sidehugs' and immediately separate. Girls on the other hand usually tend to give fuller, more frontal hugs that last longer. I'm a big hugger, and trans so I've had a lot of experience xD
However, this also depends heavily on the type of person and who they're giving the hugs to. For example, an introvert might give looser hugs and separate quicker, no matter what gender. An extrovert (like me) might give longer, tighter hugs.
Guys tend to hug other guys very loosely, this usually involves some kind of patting of the back and a quick separation. Guys tend to hug girls more closely, and usually let her take the lead in the embrace. If she wants it to end quickly, he'll let her end it, if she hugs him for longer, he'll just follow. Girls usually hug other girls for a very long time and move around whilst hugging. Girls usually don't hug guys in such a fashion unless he is a close friend, and usually just separate after they feel it's appropriate.
And of course, for both genders, relation to the person you're hugging is a very big factor, a person might not hug a stranger for as long as they would hug a friend, if at all. This is just my experience.
However, I just like to say 'Screw the gender binary' and let people hug how they want 8D Of course others may not agree. But hey, I'm going full-time and still give the closest, tightest hugs I can afford xD, occasionally lifting my friends off the ground. My advice is: hug however you want as long as you feel comfortable. :)