Use STL for a simple 3D print. Use OBJ when you need materials, textures or large polygon faces in a 3D editor. Neither format reliably stores the model's unit.
Compare them
| STL | OBJ | |
|---|---|---|
| Faces | Triangles only | Triangles and larger polygons |
| Materials | No standard | Separate MTL file |
| Textures | No | Separate images and UV coordinates |
| Named groups | Not normally | Yes |
| Unit | No | No |
| Number of files | One | Often several |
For 3D printing
STL is simple and widely supported. OBJ also works in many slicers, but materials are often ignored. For color, 3MF usually has clearer support.
An OBJ made for images can have single surfaces, open bottoms and very thin details. Check its mesh before printing.
For 3D editing
OBJ can keep four-sided faces. These are easier to edit and smooth than a dense triangle mesh. It can also keep separate groups and texture coordinates.
OBJ does not store animation. For that, use FBX, GLB or the editor's own file.
Updated
Questions
Is OBJ better quality?
Not automatically. Quality depends on the mesh that was saved. A coarse OBJ is still coarse.
Can STL have color?
Some programs add their own color data to binary STL. Other programs may ignore it, so choose 3MF or OBJ instead.