Temporary tables are just that. They are used most often to provide workspace for the intermediate results when processing data within a batch or procedure. They are also used to pass a table from a table-valued function, to pass table-based data between stored procedures or, more recently in the form of Table-valued parameters, to send whole read-only tables from applications to SQL Server routines, or pass read-only temporary tables as parameters. Once finished with their use, they are discarded automatically.
Temporary tables come in different flavours including, amongst others, local temporary tables (starting with #), global temporary tables (starting with ##), persistent temporary tables (prefixed by TempDB..), and table variables.(starting with (@)
Local temporary tables will remain till one session only, and once you close the session they will be deleted. They will be visible in your session only.
Global temporary tables are visible to any user, but once they all will close there instance it will drop automatically. While persistent temporary tables will be visible to all and you need to drop it explicitly.