Why are PSD files so large? I added a 317kb jpg background img into a psd file



Because the data is uncompressed. Once you pasted the jpg image into the Photoshop file it ceased being a jpg and became raw image data again. The complexity of layers in the image will help determine the file size. For example, a layer filled with a single colour will be a much smaller file size than one filled with, say, a picture of trees covered in autumn leaves. Obviously the more layers you add the bigger the file size as well.

Think of a Photoshop document as you would a RAW photograph from a digital camera (uncompressed image data) vs one with a "Superfine" image quality (a compressed jpg). A 10 megapixel image (3906x2602 pixels) is going to be about 10mb in RAW format and about 2.5 mb in "Superfine" format.

A Photoshop file with many layers can grow to an enormous size. This size is usually many times larger when it's open than closed. A website design file I have open right now that has about 60 or 70 layers is about 25mb closed but it expands to more than 10 times this size when opened.