Ideally, to understand this is the order you should probably watch the movies in this order (Bracket has actual release order).
(4)Wolverine:Origins - How wolverine became so , Weapon X project (i.e. experimentation on mutants, intro of William Stryker)
(5)X-Men:First Class - How Professor X/Magneto became so - and why their love/hate relationship
(1)X-Men 1 - X-Men(prof X) Vs brotherhood (magneto)
(2)X-Men 2:United - (X-Men & brotherhood) Vs William Stryker (Weapon X program guy)
(3)X-Men 3:The last stand - X-Men Vs brotherhood
(6)The Wolverine - Stand Alone plot, of someone trying to get Wolverine's healing abilities
Now, the next one, if it follows the comics, should be watched at the end, as it is about future guys trying to warn older guys to "not" to do something or do something in order to prevent and change the timeline.
(7)Days of Future Past