Hereford, a division below their opponents, took the lead in the 12th minute with a close-range goal from Tom Barkhuizen.
But Bournemouth levelled in the 39th minute when former Hereford winger Marc Pugh ran clear and beat two defenders before firing home.
They took the lead in the 66th minute when Stockley shot in off a post after being put clear by Ryan Doble.
Stockley scored again in the 77th minute when he ran clear again onto a pass from Pugh.
Bournemouth completed the scoring in the 84th minute with the best goal of the night, a powerful right foot shot from the edge of the area by new signing Shaun MacDonald.