WASHINGTON—Four of the biggest names on Wall Street struggled to pass the Federal Reserve’s 2015 “stress tests,” and the U.S. units of two foreign banks fell short, underscoring the constraint the annual exercise imposes on the largest banks more than six years after the 2008 crisis.

Goldman Sachs Group Inc., J.P. Morgan Chase & Co. and Morgan Stanley received the green light to return income to investors only after adjusting their initial requests to ensure capital buffers stayed above the minimums required by the Fed.

...