Ferguson made his senior Brighton debut in 2021 under Graham Potter, who was appointed West Ham manager last month.
"It was a big opportunity for me to come here. I know the gaffer well and look forward to working under him again," Ferguson told West Ham TV.
Ferguson was sidelined for nearly five months last year with a cruciate ligament tear and an ankle injury in December then kept him out for over a month until he returned on Saturday in Brighton's 7-0 loss at Nottingham Forest.
West Ham, 15th in the table, visit sixth-placed Chelsea later on Monday.