Comet 67P Churyumov–Gerasimenko's mass is 11 orders of magnitude lower than Earth's. That means that the comet's gravity force is also weaker than Earth's in the same proportion. Provided that also the comet's shape is irregular (so one cannot easily model it as a sphere as we do in Earth's school problems), how does Rosetta spacecraft manage to keep a stable orbit around the comet? Can't other more massive nearby objects affect the orbit? Perhaps Rosetta is permanently consuming fuel to modify its trajectory in an artificial way to follow an orbit? For how long Rosetta can keep a stable long term (thrust-less) orbit around the comet?
Rosetta initially went round the comet in a roughly triangular orbit using its thrusters to change direction. Eventually in September 2014 it entered a true orbit at a distance of about 30km going round once every two weeks. The orbit can hold in such weak gravity because it is very close and slow compared to satellites orbiting Earth.
It has now moved closer and goes round a little faster but needs to keep its velocity well below the escape speed which is about 0.5m/s at the surface. As the comet nears the Sun it will need to contend with tidal forces, solar radiation and comet out-gassing which might destabilize the orbit so that thrusters are needed to make corrections ( I can't find any specific information about this )
The Comet needs to be inside the Hill sphere of the comet to ensure that other objects do not take it out of orbit with tidal forces. At the moment the radius of the Hill sphere is about 600km but it will shrink as the comet nears the Sun in proportion to the distance away.
The non-spherical shape will mean the orbit is not quite elliptical but the effect is small and conservation of energy and angular momentum is enough to ensure stability of an orbit even round an oddly shaped object.
A stable orbit requires that the orbital insertion velocity be just right. Too high and the spacecraft flies away on a hyperbolic trajectory. Too low and it eventually falls and impacts the planet (or comet in this case). Upon approaching a planet or comet the spacecraft will perform a delta-v maneuver, a burning of thrusters that insert the spacecraft into some eccentric orbit. For planets the gravitational anomalies are small and so the the orbits are near ellipses or circles, but there are nevertheless perturbations. For 67P the irregular shape results in rather large perturbations and so the orbits are probably not even recognizable as ellipses or circles but rather chaotic trajectories around the comet. But even with chaos the orbit can be bound to a 'stable' orbit where the spacecraft will neither impact nor fly off.