the flue from a heating appliance must comply with approved document J of the building regulations.
It can get complicated, because the requirements vary according to the type of appliance, the room in which it's situated, and the wall or roof through which the flue passes.
You mention that 'smoke' enters the neighbouring property, so I'm assuming this is a wood-burning stove. That being the case, and speaking generally, if the top of the flue pipe is within 2300mm measured horizontally of a window or other opening in the building, it must rise at least 1000mm above the top of the window or opening.
That means that your flue must run up the rear wall of your house and terminate at least 1000mm above the top of your neighbour's nearest window, if that window is within 2300mm of the flue.