To connect them continuously there are many ways. Number the dots in rows: row1: 1 2 3; row2: 4 5 6; row3: 7 8 9.
Rectangular connection: 1-2-3-6-9-8-7-4-5(-1); 3-2-1-4-7-8-9-6-5(-3); etc.
Zigzag or Snake: 1-4-7-8-5-2-3-6-9(-1); 1-2-3-6-5-4-7-8-9(-5-1); etc.
Triangular connection: 4-7-8-9-5-1-2-3-6(-5-4)
The brackets just show how you join the last dot to the first. You can rotate all these patterns or start at different points to make the same patterns with different numbered dots,
Continuous connection with 4 straight lines: Although we're going to connect only 9 dots, to illustrate what to do I've started with a square of 4 by 4 dots and numbered them 1 to 16 in rows: 1-4, 5-8, 9-12, 13-16. Join the dots in the following order: 8 12 (16) 11 6 (1) 2 3 4 7 10. The 9 dots you want to join are in 3 rows of 3 inside the 4X4 square: row 1: 2 3 4; row 2: 6 7 8; row 3: 10 11 12. The numbers in the brackets don't belong to the 3X3 square, because they're just to show which way you draw. You can see that the numbered dots in this smaller square all appear just once and you have used just 4 lines to join them without having to lift your pen off the paper!