The table name is stored in pg_class when you execute the CREATE TABLE statement. The PostgreSQL main program, "postmaster" handles all the work.
It appears to me your concept of how PostgreSQL works is very distorted. Perhaps you would best be served by purchasing and reading "Beginning Databases With PostgreSQL".
Also, could you tell me during which stage(whether parser,optimizer or executor) does the table name gets stored, and if possible could you tell me which program specifically does that.
Usually parser, optimizer and command execution work with data from pg_class table. I don't understand to second question. if you need some points to postgresql source code - then magic word is "relname"