Yes, oil is needed on a sewing machine to keep it running smoothly and quietly. It will last longer and stitch more evenly as internal parts move or rotate without friction, well far less friction.
Not all oils are the same. Some oils thicken with age, so your machine may be running smoothly when you put in in the cupboard, but after many months, that oil will thicken and clog up the moving parts. When needed for your next sewing project, your machine could be a little clunky or even too tight for the motor to move the needle up or down. I would always recommend using proper sewing machine oil like this Singer oil. Don't use WD40 or normal oil you would use in the garage.
Machines, like the high end embroidery machines, need 6 different types of lubricant. Each oil/grease type is different. One oil used on the Brother PR multi-needle models for example is black ;for some reason! Each is used on different mechanical components inside the machine, possibly where metal/metal, metal/brass, ball bearing or metal/plastic meet.
Some sewing machines are self lubricating; this is not to say the machine does not need maintenance or oiling. To disassemble a computerised machine for internal lubrication, is a little beyond this tutorial and best left to us experts and trained engineers in our workshop.
For this "where should I oil my sewing machine" tutorial, we will focus on the more basic models.
Only a tiny amount of good quality oil is needed. Over loading with oil will only cause oil contamination to the thread, the needle or the fabric your stitching. Only one small tiny drop of oil is required at every oiling point.
First clean the machine, remove all fabric lint and thread ends. Use a lint brush and a clean cloth.
Oil is needed on every metal on metal moving part you can access.
Some sewing machine models allow strip down; some users may be able to gain internal access further than others.
Starting at the top, it may be possible to unscrew and remove the top cover. Often it lifts off giving a good view of many moving parts that need oil. Also a tiny drop of oil can be offered to the bobbin winder shaft, making sure not to get any oil contamination on the motor belts, the hand wheel or bobbin winder ring.
Above the needle: The needle bar flies up and down at about 100 miles-an-hour when stitching at speed. It also moves left-to-right, this is called the bight moment! This needle bar needs oiling as well as the link bushes, that take the drive from the rotating top shaft to the liner movement on the needle bar.
Around the bobbin case: Put one drop of oil around the metal/metal spool case and under the machine if access can be gained. The main bottom shaft will have two bush bearings requiring oil as well as may be the gears and excentric feed cams. Keep oil away from any belts whilst working under the machine.
Wipe any excess oil off using a cotton cloth.
Test sew a sample, using a light coloured cotton fabric, cotton thread and a new needle. Test sew a few stitch lines forwards and in reverse, and lookout for any oil stains on the fabric. There should be no oil contamination on the fabric.
Remember, oil will not fix a problem but the correct oil helps avert a problem. Happy stitching.
Below shows a modern Brother sewing machines internal machanical moving parts. Oil is needed on the points marked in red.