Yes, there is a limit to the number of files that can exist in a directory. That limit depends on what file system you're using though, and potentially on what options were used when you formatted the file system.
By default on ext3 (and I believe ext2 as well), the limit is 32,000 files.
EDIT: Further reading, as well as my own testing, suggest that the 32,000 file limit is no longer an issue in modern kernels with ext3. However, there is still a 32,000 sub-directory limit, so while JdeBP's comments are technically correct, that huggie asked, and I answered the wrong question... the gist of the answer is the same.
Consider this test:
$ mkdir asdf
$ for x in $(seq 1 32000); do mkdir $x; done
mkdir: cannot create directory `31999': Too many links
mkdir: cannot create directory `32000': Too many links