Note: this is a simplified answer, aimed at the level of the question. It isn't technically precise, but concepts like "below" are probably much easier to visualise than more exact terminology.
The answer by Javier is correct, but some elaboration might help.
When we discuss ordinary isolated astronomical objects like planets, stars, neutron stars, and black holes, the intensity of the gravitational force is governed by two things: how much mass there is, "below" you, and how far from the "centre" you are.
How much mass "below" you
Using fairly ordinary calculus, we can show that if we have a spherically symmetrical mass (which roughly describes any planet, star or black hole), then the only gravity you experience from it, comes from the mass "below" you.
Example: the earth is a sphere about 8000 miles radius.
- If you stand on the surface, you feel the force of gravity from the entire earth's mass, at a distance of 8000 miles from its centre.
- But if we could go 2000 miles down, you would experience the force of gravity for a sphere with the mass of only the inner 6000 miles of the earth, not the whole 8000 miles, which would be weaker. The outer 2000 miles wouldn't have any gravitational effect overall, either plus or minus.
- But.... at 2000 miles down, you would also be much closer to the centre of the earth as well, and this would also make the force of gravity stronger, somewhat counteracting the reduced mass.
How close to the "centre" you are:
The closer you get to a mass, the more intense the force of gravity from it.
One exception is the example above - if being closer also means being inside it, then in effect, there will be less mass to act on you.
Your question: star vs. black hole:
Imagine the sun, compared to a black hole with the sun's mass. In this case you aren't "inside", so the only things affecting how intense gravity is, are the mass - which is the same - and the distance from the "centre".
The sun has a radius of 700,000 km. The black hole has a radius of 3km. They both have the same mass "below" them. The intensity of the gravitational field is proportional to the square of the distance.
Because the mass "below" is the same, but the distance is 233,000 x less, gravity is 233,000^2 = 55 billion times stronger at the 3km "boundary" of the black hole. (3km is the closest anything can get to the black hole without being "lost" to us within it)
That 55 billion times stronger gravity is why light is much easier to see bending round the edge of a black hole than the edge of the sun. It's also why any closer and light can't escape a black hole, while it can escape the sun.
But the effect exists for both of them. Using very careful measurement, we can see the mass of the sun also bending light, and warping spacetime. It's just that the effect is so small it would be very hard to detect with the naked eye.