If I only had six months left to live, I would spend my time eating, sleeping, drinking, partying, and enjoying myself. There would be no point of saving anything up if I surely knew that I will be dead after six months. In such a scenario, I think that I would prefer spending all the money that I had saved throughout the years if it is not of benefit to my family.
Nevertheless, my prime goal would be to enjoy whatever time that I have yet to live. And yes, I would also start praying more for a chance to go to heaven.