There’s no need to frame an oil painting under glass if it’s painted on canvas, panel, or board. The exception is if the painting is done on paper or thin card, which should be framed under glass to protect the support from environmental damage more than the oil paint. With sturdier supports, the final varnish applied to the painting is considered sufficient protection. (Remember though that an oil painting shouldn’t be varnished for at least six months after you’ve finished it to ensure the paint is thoroughly dry.)
If you’re wondering why you see oil paintings under glass in a museum or gallery, this is as extra protection against vandalism and, if special glass is used, from damage through exposure to light. If you do decide to frame an oil painting, remember to ensure the mat (framing mount) is thick enough to prevent the paint from touching the glass.