Wow. Lots of questions. I'm glad you're asking them. Too many people end up doing charity work.
Here goes:
How do you decide how much to charge for a custom built software project? Do you work from a formula? Have a set price for different types of jobs?
Unfortunately, the answer to this is: it depends.
I personally charge by the hour. Some clients want a fixed bid; that is, a set price to cover an entire project. I don't do that, but it might work for you.
It really depends upon a) your estimating skills and b) your ability to be firm about enforcing change control and freezing the spec once it's been approved by the client.
NOTE:
It is vitally important that you get a thorough functional spec from the client (even if you have to help them write it) BEFORE you write a single line of code. Make sure they sign off on it. Use it as your bible.
As far as an hourly rate, it depends on what you do and where you are. For example, I charge as much as $85/hour depending on what I'm doing. This is based on rates for similar services in my area.
You need to shop your competition and see what the prevailing wage in your geographical area is for your skills.
Also how do you collect payment? Incrmentally? All up front? Upon delievery?
Again, it depends. With new clients, I make them pay 30% of the estimated hours up front. Then I bill them each time we hit a predetermined benchmark. I turn down work from prospects that aren't willing to do this. But that's just me.
Once a client has established themself with me as being good to work with, I no longer demand 30% up front on their next project. I also bill them monthly instead of per delivery. Troublesome clients never get past the "30% down and I'll bill you per delivery" stage.
But again, this depends upon what you and your client negotiate. Some clients refues to pay a dime until completion (be wary; these are the same clients that are most likely to try to weasel out of payment). Other clients might want a discount to pay up front. Others will only allow you to bill them according to their accounting cycle.
There are many permutations. You need to find one that works for you and your particular clients.
edit: Rereading your post, it sounds as though you're looking for help in estimating the total hours a project will require. Is that the case? If so, do you have a functional spec?