Where are tempory tables or record sets located?
It depends on mode used (buffered/unbuffered), as explained in the PHP manual:


  Queries are using the buffered mode by default. This means that query results are immediately transferred from the MySQL Server to PHP and is then kept in the memory of the PHP process. This allows additional operations like counting the number of rows, and moving (seeking) the current result pointer. It also allows issuing further queries on the same connection while working on the result set. The downside of the buffered mode is that larger result sets might require quite a lot memory. The memory will be kept occupied till all references to the result set are unset or the result set was explicitly freed, which will automatically happen during request end the latest. The terminology "store result" is also used for buffered mode, as the whole result set is stored at once.


Further reading


http://php.net/manual/en/mysqlinfo.concepts.buffering.php
http://dev.mysql.com/doc/apis-php/en/apis-php-mysqlinfo.concepts.buffering.html


This is answer to the "body" of your question. The title of that question asks about temporary tables, which are a different thing, internal to MySQL. If you are interested in that too, it is covered at https://dev.mysql.com/doc/refman/5.5/en/internal-temporary-tables.html

Simply said, MySQL stores small and simpler temporary results in memory and bigger ones and/or ones used in some more complex operations are stored on disk usually in temp folder.