맞다 is broader in meaning and usage than 어울리다. It can mean fitting/matching something or being suitable/appropriate for a situation, but its base meaning is being right or correct (맞다: right <-> 틀리다: wrong).
어울리다 means being in good harmony with, or being suitable or appropriate for something, that is, to go together well with another thing. It can describe people associating with others, for example (친구와 어울려 놀다).
- 이 옷은 나에게 꼭 맞는다 = This can mean fitting exactly in size (more likely) or looking perfect on me.
- 그 셔츠가 네 바지와 잘 어울린다 and 노란색이 너에게 잘 어울린다 mean looking good with the other thing.
- 상황에 맞게 행동하는 것이 중요하다.
- 상황에 어울리게 행동하는 것이 중요하다.
These mean more or less the same thing, but I think 맞게 is a better choice of word. 어울리게 sounds softer and a bit vague here.
1. ... 안경이 변화된 시력에 맞지 않아 ... (O)
2. ... 안경이 변화된 시력에 어울리지 않아 ... (X)
어울리다 can't be used for things requiring strict correctness or compatibility as a corrective lens.
Other examples of 맞다.
- 맞는 답을 고르시요 = Select a right answer.
- A: 난 네가 잘못했다고 행각해. B: 그래, 네 말이 맞는 것 같아 = Yeah, I think you're right.
- 결혼이란 많은 사람들 중에서 자기에게 맞는 사람을 찾는 것이다 = Marriage means finding the right person for you out of so many people.