The same rules apply for hanging a hammock as for camping. You must be at least 150 meters away from the nearest inhabited house/cabin and can stay there for up to 2 nights.