Typically the difference implies a quality of the material itself:
Things like glass, plastic, bone and other rigid materials shatter. Shattering is the act of bursting into many small pieces after a forceful impact.
Things like wood, bone, and other fibrous materials splinter. Splintering is more of a tearing action where small spicule shaped pieces are torn from the greater mass.
(And, yes I know that bone is in both categories, but it depends upon the mechanism and force of the injury.)
For the most part, people would use shatter to describe their windows. Glass can splinter, but shatter is a much more common term for the breaking of it.
Neither of these terms is 100% exclusive, and they are often used interchangeably, but following the distinctions above will generally keep you out of trouble.