Firstly, my "C code" listens serial Port all the time so I want to make file and writes all data which I receives from serial Port. and I have a question: Is there any necessary condition which file will be best or what file Extension will be better, or is there any good rules, advice?
It depends what you want to do with that file afterward and the information transmitted by the serial port.
Using a text file is easy and is often enough for a lot of situation, in particular if the objective is to keep a log.