From the British and Commonwealth perspective , individual gun batteries would be deployed in support of an Infantry Corps objective as a part of an Artillery Corps. Artillery Corps units would remain with Infantry Corps for the duration of the operational task. Batteries within these Corps were organised into Divisions and divided into Brigades which were relieved and rotated out of the lines much in the manner of an Infantry Brigade, moving to the immediate rear areas for rest during operations. This was done at set intervals to coincide with rested batteries of their division, coming into the line. The larger overarching Brigade formations would eventually move to billets and bases in towns well behind the lines after the battle was complete, taking their batteries with them.
Tactical command of individual Brigades, however, may be exchanged between Divisions. Brigades might transfer guns to another Brigade within the Division on their departure. Some batteries were 'rested' in the forward areas, usually in dug outs built near the gun revetments. The men sometimes stayed with their guns for the duration of the divisional action, for around 10 days to two weeks in some cases. Staying in the lines for this long was understandably quite hazardous, and usually the individual batteries were rotated within the divisional formations, to rear areas, not completely out of the line, within in a shorter time frame.
The Artillery on the Western Front was structured to in a way somewhat similar to an Infantry Corps, with Corps Command, Divisional Artillery, Artillery Brigades, and Artillery Batteries, composed of a range of guns types and given a range of tasks. The forward batteries generally having lighter field guns, rather than the heavy guns further back. One way to look at this structure is that the Heavy guns were more strategic, and well behind the line. The Field batteries were lighter, more mobile, smaller calibre field guns used in support of operations, and sub-classes like trench mortars, machine guns companies and even infantry rifle grenades were more tactical in nature.
When they were being relieved, the batteries within the division left their guns behind, which were then "handed over in-situ" to the next artillery battery to move in and occupy the position. As battles progressed, the guns were required to move forward, sometimes on the day of the main advance, often into unprepared positions. One distinction from infantry movements is that the artillery formations would move with their artillery ammunition, so when they moved into a new gun position, they would bring shells with them and in some cases, take their remaining ammunition with them when they left. They were also sometimes accompanied by a Divisional Ammunition Column.
Sources on this seem to be limited to war diaries of individual units, describing movements to and from batteries, as most books cover strategy and tactics, and not so much the operational matters.
Sources:
Australian Imperial Force unit war diaries, 1914-18 War. AWM4 Class 13 - Artillery
The Monstrous Anger of the Guns by Jackson Hughes.