This Technet document gives details on the limitations (& effects on performance) for SharePoint 2007 document libraries - Plan for software boundaries.
As stated in the above link - a document library can have 5 million per library (using nested folders, standard views & site hiearchy). The limitations to occurs due to the number of items per view (at ~2000). So customization of views may be needed.
Here's a summary of the limitations - SharePoint 2007 Maximum Limits.
UPDATE: One can use the SharePoint 2007 feature of 'Work with site content and structure' to handle the files. I recollect encountering performance degradation as the number of nested folders increase (i.e, deeper site hiearchy are more prone to performance issues). Regarding time-outs - it would vary based on your environment and the file-types and the number of files (some test runs may help - for e.g., a target folder at a time). There are commercial tools that can help with the migration and also one can develop scripts to do the same.