I assume you want to do this on the command-line.
Most command line tools work in a line-based manner, so to do this you first need to convert the wordlist into lines, this is easily done with tr ' ' '\n', which transliterates all spaces into new-lines. Then use the solution described here to sort by line length. Finally convert back to single line with paste.
echo 123 b 1 4rr f k3j3 gg \
| tr ' ' '\n' < wordlist \
| awk '{ print length, $0 }' \
| sort -n | cut -d' ' -f2 \
| paste -s -d ' '
Output:
1 b f gg 123 4rr k3j3
See info tr, man awk, info sort, info cut and info paste for more.