You will probably find that in the early stages of your freelance career you spend more time marketing yourself and your services than you spend actually working. There's a financial cost to that, of course. For this reason, the early days will be lean and mean. Make sure you have the financial wherewithal to survive this period. You will only make money as a freelancer if you charge more that it costs you to do the work in terms of your time, expenses and materials.
Some freelancers charge by the hour and others by the project.
In reality, you will probably use a combination of both methods depending on the nature of the job and the client. You can get an idea of current market rates by surveying your competitors. So you'll probably need to employ a bit of subterfuge here by posing as a potential customer, for example. In fact, it's in your legal interests that your competition doesn't give you pricing information if it knows you're a competitor. Such conduct can be construed as price fixing which can land both of you in extremely hot water.