How Many Times Does a CTE run
Putting aside the syntax was not correct (before the edit).

NO it does not get put in memory.  

A proper example is a join. It will get call multiple times in a loop join.  On an expensive CTE called multiple times then materialize to #temp is the way to go.