This effectively asserts your copyright. Most publishers prefer work that is represented by an agent and give it better attention. The exception is children's books, which may or may not be agented. Expect to pay 10 to 15 percent of advances and subsidiary right sales that your agent negotiates. You should not have to pay any advance fees.
Most agents prefer to see a query letter first.
There's no correct length for a novel or nonfiction work. Write until you have told the story or covered the topic fully. The key is to make your work readable. Use a simple 12-point or larger font, double space, provide reasonable margins and type on one side of plain white paper. Don't bind the pages.