For me it works on some sliding scales. Here are my thoughts :
1 - The later it is in the game the less likely I am to raze and replace the city, because rebuilding takes time, and generally the cities you take are more mature. If the game is in the bag I generally tend to puppet for less management.
2 - The fewer turns / policy I am getting makes me more inclined to puppet in order to continue the ratio. The longer it takes between each social policy the more I am inclined to annex for more control.
3a - The more I feel a requirement for a stronger economy the more I tend to puppet and leave them financial. If I have a stronger economy and money to burn I am more likely to annex. Buying the courthouse and maintaining it does cost $$$, but the result is usually a better city under your guiding hand.
3b - Settlers and courthouses. Raze and replace does require the construction or purchase of a settler. These things are not free. Puppeting is free. The cost of a settler compared to the cost of a courthouse depends on things like wonders, policies etc. but they are more or less on par upfront unless I picked liberty and my capitol has spare time to crank out a quick settler. After that there is the maintenance fee of the courthouse which a settler does not invoke. If I expect the game to last 100 more turns that is 300 gold which is not even required upfront. The overall cost difference here is not very significant.
4 - The better the city, based on surroundings the more likely I am to annex. I generally look for a blueprint city, if it is a text book city for high population, production or has a ******** number of luxuries with +gpt I will annex them so that I can optimize their management and get the most out of them. If it is on the other continent I will go for the annex the first couple times to spam buy units. The poorer the location, for example it being positioned horribly I am more inclined to puppet or even raze it. With that in mind I am really not very picky about placement on non-core cities, it does not need to be optimal just 'ok' for me.
5 - Happiness. I try really hard not to take land I don't have the happiness to hold on to. Before I take a city I decide what I want to do with it, and I generally hold off taking it until I have enough happiness to do with it whatever I deem is required of it. Razing, puppeting and annexing all require happiness in varying amounts. Then I make sure I have however much happiness is required before proceeding. This requires timing with your tech and warring, but in the end the goal is really no matter what you build it should be happiness neutral in the long run based on your city's production, and happiness can be bought for annexed cities, or replaced cities (which boils down to economy). With puppeted cities you have a little less control, but if they refuse to hold their happiness weight and you are in need of the happiness you can always change your mind. Happiness has a short term factor which should be considered, but in the long term it really just boils down to a break even proposition, where in order for things to scale each city needs to carry it's own happiness weight, with the possible exception of your capitol.
6 - Workers. I like to have enough workers on hand to keep cities as optimal as possible. Generally that is 4 workers to start who follow my grand army around making a road and fixing up tiles, and scaling as needed. If my workers are so backlogged that taking a city means it will sit on improperly improved or unimproved tiles for 30 turns I generally need more workers. This observation here is that a replace city requires worker power less urgently than a puppet or annexed city.
7 - Enjoyment. I don't really like worrying about cities that are not very important, and having to manage them. Turns take too long, and it sucks some of the fun out of the game for me when I have too many cities under my personal control. Maybe for some people city management is what makes the game enjoyable and they want to do as much of it as possible. This gives one a natural bias towards or away from puppeting. I also know some people (Nate) who are downright OCD about city placement, and for them the game is less enjoyable if there is 3 wasted tiles on the map. These people tend to love raze + replace.
Once that is all done I take these sliders and I apply weights to them based on my victory type, race and mood and then out pops a decision. Some things like point #6 get weighted very lightly, others get weighted more heavily. I take my hat off to the civ developers for making this something other than a cut and dried answer. In the end all 3 options can be made to work for you and your empire, it just depends on how you like to play, and how your empire is doing. Me personally I like to puppet a lot, but if they gave puppeting a handicap I would go to the trouble of one of the other solutions, which would really to me be more effort and less enjoyment of the parts of the game I enjoy.