Power to weight ratio and gearing determine acceleration rate. Top speed is determined by the force causing the car to move, horsepower, and the forces resisting the cars motion, primarily wind resistance and friction. Engine torque (twisting force measured in pounds-foot, Lbs-ft) and speed (measured in revolutions per minute, RPM) are measured on a dynamometer. Horsepower is then calculated. Engine speed, in RPM times torque, in pounds-foot divided by 5252 = Horsepower. How to increase engine horsepower is a whole story on its own.
Wind resistance is primarily determined by two factors. The coefficient of drag, CD. CD is determined primarily by the shape of the vehicle, like a sleek ship being faster than a barge. A lower CD number = more slippery shape. The other big factor is frontal area measured in square feet. It takes far less power to push a small car through the air than an equally sleek tractor trailer.
Gearing is another big factor. Car engines produce maximum power at only one rpm. The trick is to gear the vehicle to produce maximum power at maximum speed. Most street cars have a top gear that is primarily there for economy. The engine does not have enough power to pull top rpm in top gear. Top speed can be achieved in a lower gear. This is called power limited top speed. Far less common is the other scenario, a car that redlines in top gear and could accelerate again if only it had another gear. This is called RPM limited top speed.
Lastly on any given day top speed of a car can vary. Tire pressure and rolling resistance, air density and temperature, fuel quality, tail wind/ headwind etc. With the right information on power, drag, frontal area, gearing etc. a very educated guess can be made/calculated as to theoretical top speed, but as carmania said in the end it must be tested to know for sure.