It might be because one of your screens doesn't work as well as it should?
If 3DSes are anything like DS Lites, then they check if both screens are working as they should throughout the whole playing experience. If in any situation it is not working, it will shut off. That's how my DS Lite died.
Is it only when you play Pok?mon? Is there an exact uni-formal time when it does so? Does it only happen during battles in which you use 3D?