does it do it when you have it charging? if not, then check the battery and see if it is loose. if so, you may be able to fix it with a sliver of paper or whatever so it will fit tightly in the case.
My Galaxy Tab 3 10.1 (around a year old) for the past months, turns off for no apparent reason. Even the slighest touch or nudge can make it turn off. And sometimes I even have difficulty turning it back on. The only surefire way for it to stay on is to charge it. Pls. help and ty in advance