Nurses should ideally perform hamstring stretches both before and after their shifts. Stretching before a shift can prepare the muscles for the physical demands of the day, while stretching after a shift can help in muscle recovery and reduce soreness. Additionally, periodic stretching during breaks can alleviate muscle stiffness and improve circulation.