Is there a way to output a text at some (x,y) position having a certain "size", such as a numeral '1'? For example in gnuplot, we can use
plot ... using x:y:size w labels center...
Is there something similar which I can use with the libjpeg library?
No
libJPEG is only a loading/saving library. It allows the conversion of JPEG to other more workable formats and back. You will need some sort of image processing library (e.g. OpenCV) or high-level graphics library (e.g. DirectX, SFML). There are a lot of image libraries that implement writing of text on a bitmap. libJPEG will allow you to decode into a bitmap format in memory and from there you can work with pretty much any other library that has functions that write text onto a bitmap.
Personally, I would just use SFML since you can load a JPG file (or any image format for that matter), set that texture as a render target, render text, and then get the texture for that and save it back. But any high level graphics library should do the trick...like listed above.