Taken straight from apple's website(for the 2014 13" model):
Dual display and video mirroring: Simultaneously supports full native resolution on the built-in display and up to 2560 by 1600 pixels on up to two external displays, both at millions of colors
It would also help to mention the specific model that you have as there is a possibility that it can't support it if its an older model.
Note: There is a resolution restriction and you wouldn't be able to drive 4k displays at their full resolution