Quoting directly from "The Making of Yesterday's Enterprise" by Eric A. Stillwell
Ironically, after everybody had read the script for "Yesterday's
Enterprise" the studio agreed to spend a little more on the episode
than they normally would spend on an episode (at the time, usually in
the neighborhood of $1.2 million dollars, according to Daily Variety).
The extra money in the budget allowed departments to do things we
never expected they could afford when we were originally writing the
story. A portion of the budget would go toward the extraordinary guest
cast, including Whoopi Goldberg, Denise Crosby and Trisha O'Neil.
Still, Trent and I were both surprised to discover that the entire
Bridge of the Enterprise would be remodeled for the alternate universe
sequences in the episode - at enormous expense. The producers were
going all out to make the production values on this episode
exceptional. They also knew by now that this episode would air during
the critical February Sweeps, so the studio was willing to spend extra
money to attract solid ratings. The ratings on sweeps episodes are
critical to setting the benchmark for the advertising fees a studio or
network will be able to demand for the rest of the season for that
particular series. Since Star Trek: The Next Generation was
syndicated directly by the studio to independent TV stations across
the country, the success of "Yesterday's Enterprise" would play a
crucial role in determining how much advertising revenue would be
generated from future episodes of the series.
No specific figure is identified but based on the show's additional cast and sets, it wouldn't be too far outside the realms of reality to imagine that the episode cost as much as 2-3 normal episodes, although much of this spending (sets and uniforms, for example) would be recouped in future episodes.