When is it ok to hug a girl?

I see friends girls and guys snuggling hugging that stuff and while friendship wise I'd say I'm on the level they are on with each other I always think it seems in appropriate is or isn't it
When is it ok to hug a girl?
Post Opinion