Definition: Definitions from the Official Rules of Golf appear courtesy of the USGA.
Out of Bounds: "Out of bounds" is beyond the boundaries of the course or any part of the course so marked by the Committee.
When out of bounds is defined by reference to stakes or a fence or as being beyond stakes or a fence, the out of bounds line is determined by the nearest inside points at ground level of the stakes or fence posts (excluding angled supports). When both stakes and lines are used to indicate out of bounds, the stakes identify out of bounds and the lines define out of bounds. When out of bounds is defined by a line on the ground, the line itself is out of bounds. The out of bounds line extends vertically upwards and downwards.
A ball is out of bounds when all of it lies out of bounds. A player may stand out of bounds to play a ball lying within bounds.
Objects defining out of bounds such as walls, fences, stakes and railings are not obstructions and are deemed to be fixed.
Your ball is lying in-bounds next to a fence that marks the course's boundary. You can't take relief without penalty, and the only way to play the next shot is to stand on the other side and hit the fence.
Objects defining out of bounds such as walls, fences, stakes and railings are not obstructions and are deemed to be fixed, therefore a part of a boundary fence that is bowed towards the course so that it is inside the boundary line is deemed to be fixed – it is not an obstruction.