If I've a big sprite png image with 40x40 icons. How I can convert it to separate images for each icon with photoshop or gimp?
As the sprite is quite big I would prefer and automated method.
Okay, if you don't have too many sprites then this shouldn't take too long. It's not automated, but if that's what you're looking for let me know and I can help you with a script to do it (although at that point this begins to fall out of the bounds of Graphic Design)
Another way to do this is to select the slice tool and create one big slice around the entire image. Then, with the slice tool still selected, right click on the slice and click on "divide slice". You will have several options for how to divide the slice both horizontally and vertically. You can divide it evenly in a certain number of slices or you can specify a pixel size.
getting new icons,