I calculate that there are a possible 32 different combinations of results between us and West Ham over our last two fixtures. And if my calculations are correct, 22 of those possible outcomes would mean we definitely stay up, six of them would mean we are relegated (booooo!) whilst the remaining four would result in both teams being level on points, meaning they'd be decided on goal difference. Suffice it to say we currently have an 11 goal difference. Moreover, two of the four combinations where we finish level on points would nevertheless require West Ham to win one of the two games by a margin of at least 11 goals because the other game will have been a draw (see table below). What happens if both teams finish level on points AND goal difference I have no idea, but chances are it won't come to that anyway.
So of the 32 possible combinations of results, I believe these are the only six that would definitely send us down on points total alone:
Tottenham WL (total 41 points), West Ham WW (42)
Tottenham DD (40), West Ham WW (42)
Tottenham DL (39), West Ham WW (42)
Tottenham DL (39), West Ham WD (40)
Tottenham LL, (38), West Ham WW (42)
Tottenham LL (38), West Ham WD (40)
If it comes to it, these are the four combinations of results that would be decided on goal difference:
Tottenham WD (42), West Ham WW (42)
Tottenham DD (40), West Ham WD (40)
Tottenham LD (39), West Ham WL (39)
Tottenham LL (38), West Ham DD (38)
And here's the22 remaining results that would see West Ham relegated on points total:
Tottenham WW (44), West Ham WW (42)
Tottenham WW (44), West Ham WD (40)
Tottenham WW (44), West Ham WL (39)
Tottenham WW (44), West Ham DD (38)
Tottenham WW (44), West Ham DL (37)
Tottenham WW (44), West Ham LL (36)
Tottenham WD (42), West Ham WD (40)
Tottenham WD (42), West Ham WL (39)
Tottenham WD (42), West Ham DD (38)
Tottenham WD (42), West Ham DL (37)
Tottenham WD (42), West Ham LL (36)
Tottenham WL (41), West Ham WD (40)
Tottenham WL (41), West Ham WL (39)
Tottenham WL (41), West Ham DD (38)
Tottenham WL (41), West Ham DL (37)
Tottenham WL (41), West Ham LL (36)
Tottenham DD (40), West Ham WL (39)
Tottenham DD (40), West Ham DD (38)
Tottenham DD (40), West Ham DL (37)
Tottenham DD (40), West Ham LL (36)
Tottenham DL (39), West Ham DD (38)
Tottenham LL (38), West Ham DL (37)
Tottenham LL (38), West Ham LL (36)
Hope I've got this all correct!