Leaning against a window
Glass isn't very flexible and you stand a pretty good chance of breaking the glass, which could injure you directly, or allow you to fall out the window.

You didn't say how far the window is off the ground outside, but presumably you don't want to fall out the window unexpectedly amidst shards of glass that could end up sticking out of you at comically tragic angles.

You also didn't mention whether the window in question is made of plate glass (brittle, shatters easily, ends up in big pointy shards) or some kind of safety glass (specially treated, often has some kind of polycarbonate material sandwiched in the glass or coating one or both sides). Safety glass is somewhat less brittle, and tends to break into smaller, rounder pieces that won't impale you. Automobile windows are made out of safety glass.

So that's my way of saying no, I probably wouldn't make a habit of leaning on the window.

If you can't pick up an actual headboard for you bed as @Tester101 suggested, maybe you can just lie with your head at the other end of the bed and lean against whatever's on that end (a wall?). Or maybe you could screw a few wood slats across the lower half of the window and lean against those.