For non-rectangular shapes you have to manually insert line breaks. For rectangular shapes you may use label configuration "Cropping" together with label size "Fit Node Size" or "Fit Node Width". Both configuration and size may be specified in the properties view in yEd's lower right corner once you select a node or label.