While the kernel certainly able to handle hundreds of thousands of threads, the main limit is memory, because by default (in libc) there is around 2M of memory allocated to the stack of each thread.
With the pthread library you can create threads with a stack size smaller than this, but this limits some aspects (think of recursion, local objects etc.) of your program.
My experiences show that it is possible to be happy with 64K stack size in an event driven program if you are careful, so you can run ~500,000 threads on 64G memory if you want to. Nevertheless you'd better design your program more clever and use only a handful of threads and put them in blocking state only when you must :)
See also http://paultyma.blogspot.com/2008/03/writing-java-multithrea... for an interesting (java-centric) analysis.