HELP, FAIR FISHIE?!

I won myself a goldfish at a carnival. I was super unprepared. So we're keeping him in a large 1 gallon mason jar. I feel really bad but I don't have the money to buy a huge tank? And I have no space in my apartment for a huge tub or anything. I know I made a mistake now. But I'm about to go to the store and buy food, and water conditioner. How long will he live😰😰😰😰