First you will have to measure how tall your bed is from the floor to top of the mattress. Mine was 27" INCLUDING the joints. So my actual cut length of pvc was about 25 inches, allowing for 1 inch for each joint. I bought three 8ft lengths of pvc and that was good for my bed.
My measurements are just a guideline, as not all beds are the same height. For the joints, you will need 2 "T" joints and 6 Corner joints. You can also get pvc glue if you want your joints to be permanent. I needed mine to be easy to take apart and store under the bed so I didn't glue mine.
Since I built my stand, I also have made a custom sized beanbag to sit on the bed.
48 inches by 48 inches. I just used scrap fabric I had kicking around. (finished product ends up being a bit narrower once filling is in)