On the ISS (International Space Station), astronauts recycle some of their waste — only the kind they can yield water from. However, on the first Enterprise, this was clearly not the case. They jettisoned it directly into space.
In Star Trek: Discovery Season 3, however, this changes. At Starfleet Headquarters of the 32nd century, Osyraa (leader of the Emerald Chain) attempts to negotiate with Admiral Vance after she infiltrates HQ. As she speaks, she snacks on some delicious apple slices (among other things), until Admiral Vance tells her "It's made of our shit, you know" (referring to the food). She quickly spits out her scrumptious apple slice and gives him a look.
Between Star Trek: The Original Series and Star Trek: Discovery (when it traveled to the 32nd century), Starfleet had replicator rations. However, I'm not sure whether we were ever told where these replicator rations come from. At any rate, Star Trek: Discovery makes it clear that at that point, waste matter is recycled and used for replication. This would make sense as it would reduce the need to outsource matter.
When does this change happen?