The maximum size of TempDB, like all other databases, is ~525 000 TB, so that's the limit to how many rows you can put into a Temp Table. Probably a bit less, there's other stuff in TempDB as well.
Not limited by available memory because neither TempDB nor temp tables (nor table variables for that matter) are memory-only.
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass