I know this is old, but for anyone reading this for reference:
When you're attaching two pieces of wood, your screw should go the entire way through the first piece of wood, and half that distance into the second piece. So, if you're attaching a 2x4 (actual dimensions 1 1/2" x 3 1/2"), you'd want at least 2 1/4" screws.
That said, this breaks down with bigger lumber, and you shouldn't be screwing 4x4s together. I agree with the last poster, steel framing connectors are basically a must if you're trying to use 4x4s for a project like this, at least on the inside where they can be hidden. If you're set on screwing them together, you should be pre-drilling holes, and using lag bolts instead of screws.