The Biblical prohibition-Sewing a stable set of stitches:
One who sews two stitches and [makes] a knot [at its end], or three stitches even if he does not make a knot [at its end] is liable [to bring a sin offering].
However [one who sews] two stitches and does not make a knot is exempt [from Biblical liability, although it is Rabbinically forbidden].
The reason for this is: because [in such a case the sewing] does not last.
Tying prohibition: One who makes a knot [in any of the above cases] is also liable for the tying prohibition.
The Rabbinical prohibition-sewing an unstable set of stitches:
Rabbinically forbidden to make two stitches without a knot: Although [one who sews] two stitches and does not make a knot is exempt [from Biblical liability], it is [nevertheless] Rabbinically forbidden.
It is forbidden to stitch threads into an item even the threads will not last.
Practical Q&A on Sewing
May one attach two sides of his clothing using a safety pin?
Regarding making it into a double stitch: Some Poskim rule that this should not be done. Others rule that so long as it is not meant to be placed there for permanent use [as is usually the case] it is allowed. The Rebbe defends the practice of making even double and triple stitches for use on Shabbos, however he forbids making more than three stitches.
May one staple papers together or remove staples from papers on Shabbos?
It is forbidden to staple paper or other items together due to the sewing prohibition. This is prohibited from being done even if one plans to leave the items attached with the staple for a very short while.
As well it is forbidden to remove staples from items which have been stapled to last there permanently. However by items which their staple will eventually be removed, as is the case by a stapled envelope, some opinions allow one to remove the staple, while others are stringent.
May one place a clasp on an ace bandage to fasten it together?
Yes, as explained above regarding safety pins.
May one enter or remove papers from a metal binder on Shabbos?
Yes. However there are Poskim which are stringent regarding binders that use a flexible metal strip to folds over the papers in order to bind them.
Is zippering two items together forbidden due to the sewing prohibition?
Others however rule that it is allowed.
May one zipper the wool lining on to a coat?
If done with intent to only leave on for a short amount of time it is permitted according to all. If however one intends to leave the lining in the coat for a long period of time then some opinions rule it is forbidden to do so, as this is similar to fixing a vessel, as well as that doing so resembles sewing. Others however rule it is allowed even in such a case.
May one attach items together using Velcro?
Yes, as there is no sewing involved here at all but rather just placing of strings onto hoops.
May magnets be used on Shabbos?
 If it will not last, such as if he made two stitches without a knot at its end, it is Rabbinically forbidden. If it will last, such as three stitches or two with a knot at its end, then it is Biblically forbidden.
 Piskeiy Teshuvos 340/22
 Mishneh Berurah 340/27, in name of Karban Nisanel; Minchas Yitzchak 2/19; Sheivet Haleivi 4/35; Poseik who wrote to Rebbe about forbidding pinning clothing on Shabbos.
 Sharreiy Teshuvah 340/3; Chazon Ish Supplements to Orach Chayim 156; Igros Moshe 4/84; Tzitz Eliezer 13/43
 The reason for this leniency is because: a) The concept of sewing does not apply to metal; b) It is not made to last [of which is only Rabbinically
forbidden] c) Is being done for a Shabbos use. It is thus permitted as by a Rabbinical prohibition within a Rabbinical prohibition we are lenient
for a Shabbos use. [Rebbe in Shaareiy Halacha Uminhag 2/164]
 Shaareiy Halacha Uminhag 2/164
 So is implied from M”B 340/27, and so rules Minchas Yitzchak ibid, Rebbe in Shaareiy Halacha Uminhag Ibid and
the other stringent opinions regarding making two stitches, that by one stitch it is permitted according to all.
 So writes Rebbe in Shaareiy Halacha Uminhag ibid
 Piskeiy Teshuvos 340/20
 Bris Olam Tofer 8; SSH”K 28 Footnote 17
 Az Nidbaru 1/58
 SSH”K 28/5
 Az Nidbaru Ibid
 SSH”K 35/22
 Piskeiy Teshuvos 340/20
 Yesodeiy Yeshurun 1/201
 Sheivet Haleivi Vol. 3 chapter 51
 As this is similar to fixing a vessel, as well as that doing so is like sewing. [ibid]
 SS”K 15/74 based on a ruling of Rav Shlomo Zalman Aurbauch.
 Chelkas Yaakov 4/24
 Sheivet Halevy Vol. 3 chapter 51
 Beir Moshe and SS”K 15/74 based on a ruling of Rav Shlomo Zalman Aurbauch.