To figure out how many calories you need to eat to lose weight, you first have to know how many calories you burn every single day. This is known as your Total Daily Energy Expenditure (TDEE) or your maintenance level. TDEE of a person can vary a lot from person to person.
There many factors that can influence one´s TDEE. Factors like: Basal Metabolic Rate (BMR), activity level, Lean Body Mass (LBM), weight, gender and age. To get the most accurate measurement you have to take in to account all of these factors. There are many different methods that one can use, some more accurate then others. So to give you an example how you can calculate your TDEE, I will use the Katch-McArdle formula. It is a very accurate method compared to others
BMR (men and women) = 370 + (21.6 X lean mass in kg)
Example:
You are male
You weigh 172 lbs (78 kilos)
Your body fat percentage is 14% (24.1 lbs fat, 147.9 lbs lean)
Your lean mass is 147.9 lbs (67.2 kilos)
Your BMR = 370 + (21.6 X 67.2) = 1821 calories
To determine TDEE from BMR, you simply multiply BMR by the activity factor:
Activity factor
Sedentary = BMR X 1.2 (little or no exercise, desk job)
Lightly active = BMR X 1.375 (light exercise/sports 1-3 days/wk)
Mod. active = BMR X 1.55 (moderate exercise/sports 3-5 days/wk)
Very active = BMR X 1.725 (hard exercise/sports 6-7 days/wk)
Extr. Active = BMR X 1.9 (hard daily exercise/sports & physical job or
2 X day training, marathon, football camp,
contest, etc.)
Your BMR is 1821
Your activity level is moderately active (you work out 3-4 times per week)
Your activity factor is 1.55
Your TDEE = 1.55 X 1821 = 2822 calories
A 15-20% deficit of calories is good and safe start. If you measure your fat percentage and do the same calculation then you would have a good idea how many calories you really need.