In some rare instances yes. Most folks and guv'mint folks especially, will say YES and twice a year but... I'll caution you plus mention that you use the correct amount and type of chlorine for your well. More is not better and you can use too much and make any problem you're trying to cure worse.
Doing so can cause serious expensive problems with the water quality, pump, power cable, drop pipe, existing water treatment equipment like a softener and RO etc..
So... why are you thinking of shocking your well?