What is the recommended x length in the Diffie-Hellman algorithm?
Actually, RFC3526 does have recommendations for the random number size; see section 8, and the table listing "exponent size".

Now, it gives two different recommendations (which sounds rather less useful than giving one); the summary is that if the size of the random number you pick is $x$ bits, then an attacker can recover the shared secret with no more than $2^{x/2}$ work.  If you're happy with 80 bit security, then selecting a 160 bit random $x$ is sufficient.  If you want significantly more than 80 bit security, well, you might want to rethink the 1024 bit group.