Copyright: You own the copyright by default, and only license further use of your work. This license can be very permissive, e.g. MIT, BSD, viral like GPL, proprietary, or even insane. Its your choice, and one of the questions you should decide before talking to a customer. E.g. I prefer double license GPL+proprietary for my work. But miles may vary.

Contract: The most important points in the contract are naming stepstones, milestones, budget, payment at each milestone, payment terms. An agreement is only good, as long as you agree. It often becomes toilet paper if disputed, especially as lawsuits might be more expensive then the value of the contract, and as contracts are difficult to enforce over international borders for a freelancer. So there is no need to pay a lawyer to create a legal bullet proof contract, as you can not enforce it anyway. Better write one that a human understand. Thats not more complicated then selling your car. One of my "tricks" is to offer 2% discount, if payment is within 7 days after invoice. Any customer who can count money, and has no big cashflow problem will pay instant. Drop those who are late payers. They are often problem customers in other terms also.

Time vs money, 1st: The curse of any coder are infinite ideas vs. limited lifetime to execute them. Applying the law of diminishing returns on this, and new ideas receive a negative value. The same sooner or later shadows over the value of money, as people start to throw more money at you to solve their problems, then you ever need.

Time vs money, 2nd: I advise against selling time for money at all. Time for money does not scale, as you have only a limited lifetime, but there is unlimited money around. Selling time for money is typical for employed workers, but a professional should sell solutions for money.

Picking customers: Often customers pick you. You are lucky, you got your first client. Do a good job, and he will tell others. At first you will likely take any job that comes. But take care, that there are problem customers, who will leach your time, never pay the full amount, and claim they want more work for the money you agreed. Drop them, to concentrate on good customers.

Pick the good customers and convince them to sign a maintenance contract. I'm old and saturated now, have a semi passive income from maintenance contracts, and I'm dropping more then 80% of potential customers, often just because of a gut feeling during the first talks, before signing any paper. Signing a NDA is often the end of the talk, as ideas have a negative value for me.

Build a portfolio of skills where you are better then the average, as you already know the tools or the topic. You can offer fixed prices once you have this tools, skills, and knowledge. Fixed prices to solve problem will make much more money then selling time for money, as the value of the problem is much higher then the value of a contractor. There are basically two types of problems: Problems where you reduce the running cost of something, and problems where you increase sales. Estimate how much a solution is worth within a year, and ask for a good fraction of this for the prototype, and a smaller fraction for the maintenance contract.