Typically a laptop shutting down without warning like that is due to a heat issue. Does the laptop feel hot to the touch when it shuts down? Even if it doesn't, it can be an airflow problem. Open up the case and use some compressed air to blow any dust out (even a small amount can block airflow). You may also try using the laptop with a cheap laptop cooler under it and see if the problem improves.