You only need to go to one department, which is the Patent Office of the State Intellectual Property Office. It is located at the northeast corner of Jimen Bridge on the North Third Ring Road in Beijing. You can mail it or pay it in person.
How to apply for a patent? The perfect answer is more complicated. Let me give you two relatively perfect pictures.
Click on the link of the National Patent Office to see for yourself, it is explained concisely and clearly.
Methods to apply for a patent:
/sipo2008/zsjz/zhzs/200804/t20080418_383769.html
Patent application and approval procedures:
/sipo2008/zsjz/zhzs/200804/t20080418_383757.html